EventMachineDefer is experimental
[rainbows.git] / README
blob0e95f0eecbdff5d380a34b6010d87b9f75fb2a7b
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 * {Revactor}[link:Rainbows/Revactor.html]
17 * {ThreadPool}[link:Rainbows/ThreadPool.html]
18 * {Rev}[link:Rainbows/Rev.html]
19 * {ThreadSpawn}[link:Rainbows/ThreadSpawn.html]
20 * {EventMachine}[link:Rainbows/EventMachine.html]
21 * {RevThreadSpawn}[link:Rainbows/RevThreadSpawn.html]
22 * {FiberSpawn}[link:Rainbows/FiberSpawn.html]
23 * {FiberPool}[link:Rainbows/FiberPool.html]
24 * {NeverBlock}[link:Rainbows/NeverBlock.html]
25 * {RevThreadPool}[link:Rainbows/RevThreadPool.html]
27 We have {many more on the way}[link:TODO.html] for handling network
28 concurrency.  Additionally, we also use multiple processes (managed by
29 Unicorn) for robustness and CPU/memory/disk concurrency.
31 We also provide Rainbows::AppPool Rack middleware for some network
32 concurrency models for limiting application concurrency independently of
33 network concurrency.
35 == Features
37 * Designed for {Rack}[http://rack.rubyforge.org/], the standard for
38   modern Ruby HTTP applications.
40 * Built on {Unicorn}[http://unicorn.bogomips.org/], inheriting its
41   process/socket management features such as transparent upgrades and
42   Ruby configuration DSL.
44 * As with Unicorn, it is able to stream large request bodies off the
45   socket to the application while the client is still uploading.  Since
46   \Rainbows! can handle slow clients, this feature is more useful than
47   it is with Unicorn.
49 * Combines heavyweight concurrency (worker processes) with lightweight
50   concurrency (Events/Fibers/Actors/Threads), allowing CPU/memory/disk to
51   be scaled independently of client connections.  More concurrency models
52   (listed in the TODO) will be supported as we find time for them.
54 * We give you {lots of options}[link:Summary.html] with more
55   {on the way}[link:TODO.html].
57 == Applications
59 \Rainbows is mainly designed for the odd things Unicorn sucks at:
61 * 3rd-party APIs (to services outside your control/LAN)
62 * OpenID consumers (to providers outside your control/LAN)
63 * Reverse proxy implementations with editing/censoring
64   (to upstreams outside your control/LAN)
65 * Comet
66 * BOSH (with slow clients)
67 * HTTP server push
68 * Long polling
69 * Reverse AJAX
70 * HTML 5 Web Sockets (maybe)
71 * real-time upload processing
73 \Rainbows can also be used to service slow clients directly even with
74 fast applications.
76 == License
78 \Rainbows! is copyright 2009 by all contributors (see logs in git).
79 It is based on Mongrel and Unicorn and carries the same license.
81 Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed
82 under the Ruby license and the GPL2. See the included LICENSE file for
83 details.
85 \Rainbows! is 100% Free Software.
87 == Install
89 You may download the tarball from the Rainbows project page on Rubyforge
90 and run setup.rb after unpacking it:
92 http://rubyforge.org/frs/?group_id=8977
94 You may also install it via RubyGems on Gemcutter:
96   gem install rainbows
98 == Usage
100 === for Rack applications
102 In APP_ROOT (where config.ru is located), run:
104   rainbows
106 \Rainbows! will bind to all interfaces on TCP port 8080 by default.
108 === Configuration File(s)
110 \Rainbows! will look for the config.ru file used by rackup in APP_ROOT.
112 For deployments, it can use a config file for Unicorn and
113 \Rainbows!-specific options specified by the +--config-file/-c+
114 command-line switch.  \Rainbows! accepts all options found in
115 {Unicorn::Configurator}[http://unicorn.bogomips.org/Unicorn/Configurator.html]
116 as well as the "\Rainbows!" block, so you can have the following in your
117 config file:
119     Rainbows! do
120       use :Revactor
121       worker_connections 400
122     end
124 See the {Rainbows! configuration documentation}[link:Rainbows.html#M000001]
125 for more details.
127 == Development
129 You can get the latest source via git from the following locations
130 (these versions may not be stable):
132   git://git.bogomips.org/rainbows.git
133   git://repo.or.cz/rainbows.git (mirror)
135 You may browse the code from the web and download the latest snapshot
136 tarballs here:
138 * http://git.bogomips.org/cgit/rainbows.git (cgit)
139 * http://repo.or.cz/w/rainbows.git (gitweb)
141 Inline patches (from "git format-patch") to the mailing list are
142 preferred because they allow code review and comments in the reply to
143 the patch.
145 We will adhere to mostly the same conventions for patch submissions as
146 git itself.  See the Documentation/SubmittingPatches document
147 distributed with git on on patch submission guidelines to follow.  Just
148 don't email the git mailing list or maintainer with \Rainbows! patches.
150 == Disclaimer
152 There is NO WARRANTY whatsoever if anything goes wrong, but let us know
153 and we'll try our best to fix it.
155 == Contact
157 All feedback (bug reports, user/development dicussion, patches, pull
158 requests) go to the mailing list/newsgroup.  Patches must be sent inline
159 (git format-patch -M + git send-email).  No subscription is necessary
160 to post on the mailing list.  No top posting.  Address replies +To:+
161 the mailing list.
163 * email: mailto:rainbows-talk@rubyforge.org
164 * nntp: nntp://news.gmane.org/gmane.comp.lang.ruby.rainbows.general
165 * subscribe: http://rubyforge.org/mailman/listinfo/rainbows-talk
166 * archives: http://rubyforge.org/pipermail/rainbows-talk