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 CoolioThreadSpawn
94 %td.mod CoolioThreadPool
101 %td.mod CoolioFiberSpawn
108 %td.mod WriterThreadPool
115 %td.mod WriterThreadSpawn
137 Cool.io should also work with Rubinius (though we haven't had time to test).
139 CoolioThread* and CoolioThread* requires Ruby 1.9 reasonable performance
141 rack.input streaming is what makes
142 %a(href="http://upr.bogomips.org/") upload progress,
145 rack.input streaming is NOT compatible with current versions of nginx
146 or any proxy that fully buffers request bodies before proxying.
147 Keep in mind request body buffering in nginx is a good thing in all
148 other cases where rack.input streaming is not needed.
150 %h2 application requirements
155 %th.slowio slow I/O (backend, not client)
156 %th.thr thread safety
157 %th.reent single thread reentrant
166 %a(href="http://coolio.github.com/")Coolio,
167 %a(href="http://revactor.org/")Revactor,
170 %a(href="Rainbows/Fiber/IO.html")Fiber::IO
175 %td.slowio thread-safe Ruby
181 %a(href="http://coolio.github.com/") Coolio
186 %td.slowio thread-safe Ruby
192 %a(href="http://rubyeventmachine.com") EventMachine
196 %td.mod CoolioThreadSpawn
199 %a(href="http://coolio.github.com/") Coolio
205 %a(href="Rainbows/Fiber/IO.html") Rainbows::Fiber::IO
211 %a(href="Rainbows/Fiber/IO.html") Rainbows::Fiber::IO
216 %td.slowio thread-safe Ruby
222 %a(href="http://www.espace.com.eg/neverblock") NeverBlock,
223 %a(href="http://rubyeventmachine.com") EventMachine
227 %td.mod CoolioThreadPool
230 %a(href="http://coolio.github.com/") Coolio
234 %td.mod CoolioFiberSpawn
236 %a(href="Rainbows/Fiber/IO.html") Rainbows::Fiber::IO
240 %td.mod WriterThreadPool
245 %td.mod WriterThreadSpawn
261 Requirements for single thread reentrancy are loose in that there is
262 no risk of race conditions and potentially mutually exclusive to
263 thread-safety. In the case where a Fiber yields while holding a
264 resource and another Fiber attempting to acquire it may raise
265 an error or worse, deadlock the entire process.
267 Slow I/O means anything that can block/stall on sockets including
268 3rd-party APIs (OpenID providers included) or slow database queries.
269 Properly run Memcached (within the same LAN) is fast and not a blocker.
270 Slow I/O on POSIX filesystems only includes a few operations, namely
271 on UNIX domain sockets and named pipes. Nearly all other operations
272 on POSIX filesystems can be considered "fast", or at least
275 WriterThread{Pool,Spawn} will require thread safety if your response
276 body is dynamically generated during the body#each call.
278 %h2 middlewares and frameworks
285 %a(href="Rainbows/DevFdResponse.html") DevFdResponse
287 %a(href="Rainbows/AppPool.html") AppPool
289 %a(href="http://rack.rubyforge.org/doc/Rack/Lock.html") Rack::Lock
297 %td.async lots of RAM :P
304 %td.async Revactor itself
311 %td.async standard Ruby
318 %td.async DevFdResponse
325 %td.async standard Ruby
332 %td.async async_sinatra, Cramp, rack-fiber_pool
335 %td.mod CoolioThreadSpawn
339 %td.async standard Ruby
346 %td.async Rainbows::Fiber::IO, Rainbows.sleep
353 %td.async Rainbows::Fiber::IO, Rainbows.sleep
360 %td.async standard Ruby
367 %td.async NeverBlock, async_sinatra
370 %td.mod CoolioThreadPool
374 %td.async Coolio, standard Ruby
377 %td.mod CoolioFiberSpawn
381 %td.async Coolio, Rainbows::Fiber::IO, Rainbows.sleep
383 %td.mod WriterThreadPool
387 %td.async Standard Ruby in response body only
388 %td.ws response body only
390 %td.mod WriterThreadSpawn
394 %td.async Standard Ruby in response body only
395 %td.ws response body only
401 %td.async DevFdResponse
408 %td.async DevFdResponse
412 "No!" means it's fundamentally incompatible, use an
413 %a(href="Rainbows/AppPool.html") AppPool
417 NeverBlock also supports a :pool_size option which is one less
418 layer of complexity than using AppPool.
420 NeverBlock can neuter the Mutex class so Rack::Lock effectively
421 becomes a no-op with:
423 %code require "never_block/frameworks/rails"
424 (before Rails is loaded)
426 Everything that's DevFdResponse-compatible can use it for passing
427 async responses through