thread_spawn: document why we sleep instead of Thread.pass
[rainbows.git] / README
blobb0ac444ac3f0c75e09538e0a4408c566b464b7d3
1 = Rainbows! - Unicorn for sleepy apps and slow clients
3 \Rainbows! is an HTTP server for sleepy Rack applications.  It is based on
4 Unicorn, but designed to handle applications that expect long
5 request/response times and/or slow clients.  For Rack applications not
6 heavily bound by slow external network dependencies, consider Unicorn
7 instead as it simpler and easier to debug.
9 == \Rainbows! is about Diversity
11 We aim to support as many concurrency models as we can because they all
12 suck; differently.
14 For network concurrency, models we currently support are:
16 * {RevFiberSpawn}[link:Rainbows/RevFiberSpawn.html]
17 * {Revactor}[link:Rainbows/Revactor.html]
18 * {ThreadPool}[link:Rainbows/ThreadPool.html]
19 * {Rev}[link:Rainbows/Rev.html]
20 * {ThreadSpawn}[link:Rainbows/ThreadSpawn.html]
21 * {EventMachine}[link:Rainbows/EventMachine.html]
22 * {RevThreadSpawn}[link:Rainbows/RevThreadSpawn.html]
23 * {FiberSpawn}[link:Rainbows/FiberSpawn.html]
24 * {FiberPool}[link:Rainbows/FiberPool.html]
25 * {NeverBlock}[link:Rainbows/NeverBlock.html]
26 * {RevThreadPool}[link:Rainbows/RevThreadPool.html]
28 We have {many more on the way}[link:TODO.html] for handling network
29 concurrency.  Additionally, we also use multiple processes (managed by
30 Unicorn) for robustness and CPU/memory/disk concurrency.
32 We also provide Rainbows::AppPool Rack middleware for some network
33 concurrency models for limiting application concurrency independently of
34 network concurrency.
36 == Features
38 * Designed for {Rack}[http://rack.rubyforge.org/], the standard for
39   modern Ruby HTTP applications.
41 * Built on {Unicorn}[http://unicorn.bogomips.org/], inheriting its
42   process/socket management features such as transparent upgrades and
43   Ruby configuration DSL.
45 * As with Unicorn, it is able to stream large request bodies off the
46   socket to the application while the client is still uploading.  Since
47   \Rainbows! can handle slow clients, this feature is more useful than
48   it is with Unicorn.
50 * Combines heavyweight concurrency (worker processes) with lightweight
51   concurrency (Events/Fibers/Actors/Threads), allowing CPU/memory/disk to
52   be scaled independently of client connections.  More concurrency models
53   (listed in the TODO) will be supported as we find time for them.
55 * We give you {lots of options}[link:Summary.html] with more
56   {on the way}[link:TODO.html].
58 == Applications
60 \Rainbows is mainly designed for the odd things Unicorn sucks at:
62 * Web Sockets (via {Sunshowers}[http://rainbows.rubyforge.org/sunshowers/])
63 * 3rd-party APIs (to services outside your control/LAN)
64 * OpenID consumers (to providers outside your control/LAN)
65 * Reverse proxy implementations with editing/censoring
66   (to upstreams outside your control/LAN)
67 * Comet
68 * BOSH (with slow clients)
69 * HTTP server push
70 * Long polling
71 * Reverse AJAX
72 * real-time upload processing (via {upr}[http://upr.bogomips.org/])
74 \Rainbows can also be used to service slow clients directly even with
75 fast applications.
77 == License
79 \Rainbows! is copyright 2009 by all contributors (see logs in git).
80 It is based on Mongrel and Unicorn and carries the same license.
82 Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed
83 under the Ruby license and the GPL2. See the included LICENSE file for
84 details.
86 \Rainbows! is 100% Free Software.
88 == Install
90 You may download the tarball from the Rainbows project page on Rubyforge
91 and run setup.rb after unpacking it:
93 http://rubyforge.org/frs/?group_id=8977
95 You may also install it via RubyGems on RubyGems.org:
97   gem install rainbows
99 == Usage
101 === for Rack applications
103 In APP_ROOT (where config.ru is located), run:
105   rainbows
107 \Rainbows! will bind to all interfaces on TCP port 8080 by default.
109 === Configuration File(s)
111 \Rainbows! will look for the config.ru file used by rackup in APP_ROOT.
113 For deployments, it can use a config file for Unicorn and
114 \Rainbows!-specific options specified by the +--config-file/-c+
115 command-line switch.  \Rainbows! accepts all options found in
116 {Unicorn::Configurator}[http://unicorn.bogomips.org/Unicorn/Configurator.html]
117 as well as the "\Rainbows!" block, so you can have the following in your
118 config file:
120     worker_processes 4 # assuming four CPU cores
121     Rainbows! do
122       use :FiberSpawn
123       worker_connections 100
124     end
126 See the {Rainbows! configuration}[link:Rainbows.html#method-i-Rainbows!]
127 {documentation}[link:Rainbows.html#method-i-Rainbows!]
128 for more details.
130 == Development
132 You can get the latest source via git from the following locations
133 (these versions may not be stable):
135   git://git.bogomips.org/rainbows.git
136   git://repo.or.cz/rainbows.git (mirror)
138 You may browse the code from the web and download the latest snapshot
139 tarballs here:
141 * http://git.bogomips.org/cgit/rainbows.git (cgit)
142 * http://repo.or.cz/w/rainbows.git (gitweb)
144 Inline patches (from "git format-patch") to the mailing list are
145 preferred because they allow code review and comments in the reply to
146 the patch.
148 We will adhere to mostly the same conventions for patch submissions as
149 git itself.  See the Documentation/SubmittingPatches document
150 distributed with git on on patch submission guidelines to follow.  Just
151 don't email the git mailing list or maintainer with \Rainbows! patches.
153 == Disclaimer
155 There is NO WARRANTY whatsoever if anything goes wrong, but let us know
156 and we'll try our best to fix it.
158 == Contact
160 All feedback (bug reports, user/development discussion, patches, pull
161 requests) go to the mailing list/newsgroup.  Patches must be sent inline
162 (git format-patch -M + git send-email).  No subscription is necessary
163 to post on the mailing list.  No top posting.  Address replies +To:+
164 the mailing list.
166 * email: mailto:rainbows-talk@rubyforge.org
167 * nntp: nntp://news.gmane.org/gmane.comp.lang.ruby.rainbows.general
168 * subscribe: http://rubyforge.org/mailman/listinfo/rainbows-talk
169 * archives: http://rubyforge.org/pipermail/rainbows-talk