1 %h1 Rainbows! at a glance
3 Confused by all the options we give you? So are we! Here's some tables
4 to help keep your head straight. Remember, engineering is all about
6 %h2 core features and compatibility
11 %th.tee rack.input streaming
59 %td.mod RevThreadSpawn
101 %td.mod RevFiberSpawn
108 %td.mod WriterThreadPool
115 %td.mod WriterThreadSpawn
123 All Rev-based options can also use "Coolio" instead. Cool.io should
124 also work with Rubinius (though we haven't had time to test).
126 CoolioThread* and RevThread* requires Ruby 1.9 reasonable performance
128 rack.input streaming is what makes
129 %a(href="http://upr.bogomips.org/") upload progress,
132 rack.input streaming is NOT compatible with current versions of nginx
133 or any proxy that fully buffers request bodies before proxying.
134 Keep in mind request body buffering in nginx is a good thing in all
135 other cases where rack.input streaming is not needed.
137 %h2 application requirements
142 %th.slowio slow I/O (backend, not client)
143 %th.thr thread safety
144 %th.reent single thread reentrant
153 %a(href="http://rev.rubyforge.org/")Rev,
154 %a(href="http://revactor.org/")Revactor,
157 %a(href="Rainbows/Fiber/IO.html")Fiber::IO
162 %td.slowio thread-safe Ruby
168 %a(href="http://rev.rubyforge.org/") Rev
173 %td.slowio thread-safe Ruby
179 %a(href="http://rubyeventmachine.com") EventMachine
183 %td.mod RevThreadSpawn
186 %a(href="http://rev.rubyforge.org/") Rev
192 %a(href="Rainbows/Fiber/IO.html") Rainbows::Fiber::IO
198 %a(href="Rainbows/Fiber/IO.html") Rainbows::Fiber::IO
203 %td.slowio thread-safe Ruby
209 %a(href="http://www.espace.com.eg/neverblock") NeverBlock,
210 %a(href="http://rubyeventmachine.com") EventMachine
214 %td.mod RevThreadPool
217 %a(href="http://rev.rubyforge.org/") Rev
221 %td.mod RevFiberSpawn
223 %a(href="Rainbows/Fiber/IO.html") Rainbows::Fiber::IO
227 %td.mod WriterThreadPool
232 %td.mod WriterThreadSpawn
238 Requirements for single thread reentrancy are loose in that there is
239 no risk of race conditions and potentially mutually exclusive to
240 thread-safety. In the case where a Fiber yields while holding a
241 resource and another Fiber attempting to acquire it may raise
242 an error or worse, deadlock the entire process.
244 Slow I/O means anything that can block/stall on sockets including
245 3rd-party APIs (OpenID providers included) or slow database queries.
246 Properly run Memcached (within the same LAN) is fast and not a blocker.
247 Slow I/O on POSIX filesystems only includes a few operations, namely
248 on UNIX domain sockets and named pipes. Nearly all other operations
249 on POSIX filesystems can be considered "fast", or at least
252 WriterThread{Pool,Spawn} will require thread safety if your response
253 body is dynamically generated during the body#each call.
255 %h2 middlewares and frameworks
262 %a(href="Rainbows/DevFdResponse.html") DevFdResponse
264 %a(href="Rainbows/AppPool.html") AppPool
266 %a(href="http://rack.rubyforge.org/doc/Rack/Lock.html") Rack::Lock
274 %td.async lots of RAM :P
281 %td.async Revactor itself
288 %td.async standard Ruby
295 %td.async DevFdResponse
302 %td.async standard Ruby
309 %td.async async_sinatra, Cramp, rack-fiber_pool
312 %td.mod RevThreadSpawn
316 %td.async standard Ruby
323 %td.async Rainbows::Fiber::IO, Rainbows.sleep
330 %td.async Rainbows::Fiber::IO, Rainbows.sleep
337 %td.async standard Ruby
344 %td.async NeverBlock, async_sinatra
347 %td.mod RevThreadPool
351 %td.async Rev, standard Ruby
354 %td.mod RevFiberSpawn
358 %td.async Rev, Rainbows::Fiber::IO, Rainbows.sleep
360 %td.mod WriterThreadPool
364 %td.async Standard Ruby in response body only
365 %td.ws response body only
367 %td.mod WriterThreadSpawn
371 %td.async Standard Ruby in response body only
372 %td.ws response body only
375 "No!" means it's fundamentally incompatible, use an
376 %a(href="Rainbows/AppPool.html") AppPool
380 NeverBlock also supports a :pool_size option which is one less
381 layer of complexity than using AppPool.
383 NeverBlock can neuter the Mutex class so Rack::Lock effectively
384 becomes a no-op with:
386 %code require "never_block/frameworks/rails"
387 (before Rails is loaded)
389 Everything that's DevFdResponse-compatible can use it for passing
390 async responses through