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
136 %td.mod XEpollThreadSpawn
143 %td.mod XEpollThreadPool
151 Cool.io should also work with Rubinius (though we haven't had time to test).
153 CoolioThread* and CoolioThread* requires Ruby 1.9 reasonable performance
155 rack.input streaming is what makes
156 %a(href="http://upr.bogomips.org/") upload progress,
159 rack.input streaming is NOT compatible with current versions of nginx
160 or any proxy that fully buffers request bodies before proxying.
161 Keep in mind request body buffering in nginx is a good thing in all
162 other cases where rack.input streaming is not needed.
164 %h2 application requirements
169 %th.slowio slow I/O (backend, not client)
170 %th.thr thread safety
171 %th.reent single thread reentrant
180 %a(href="http://coolio.github.com/")Coolio,
181 %a(href="http://revactor.org/")Revactor,
184 %a(href="Rainbows/Fiber/IO.html")Fiber::IO
189 %td.slowio thread-safe Ruby
195 %a(href="http://coolio.github.com/") Coolio
200 %td.slowio thread-safe Ruby
206 %a(href="http://rubyeventmachine.com") EventMachine
210 %td.mod CoolioThreadSpawn
213 %a(href="http://coolio.github.com/") Coolio
219 %a(href="Rainbows/Fiber/IO.html") Rainbows::Fiber::IO
225 %a(href="Rainbows/Fiber/IO.html") Rainbows::Fiber::IO
230 %td.slowio thread-safe Ruby
236 %a(href="http://www.espace.com.eg/neverblock") NeverBlock,
237 %a(href="http://rubyeventmachine.com") EventMachine
241 %td.mod CoolioThreadPool
244 %a(href="http://coolio.github.com/") Coolio
248 %td.mod CoolioFiberSpawn
250 %a(href="Rainbows/Fiber/IO.html") Rainbows::Fiber::IO
254 %td.mod WriterThreadPool
259 %td.mod WriterThreadSpawn
274 %td.mod XEpollThreadSpawn
275 %td.slowio thread-safe Ruby
279 %td.mod XEpollThreadPool
280 %td.slowio thread-safe Ruby
285 Requirements for single thread reentrancy are loose in that there is
286 no risk of race conditions and potentially mutually exclusive to
287 thread-safety. In the case where a Fiber yields while holding a
288 resource and another Fiber attempting to acquire it may raise
289 an error or worse, deadlock the entire process.
291 Slow I/O means anything that can block/stall on sockets including
292 3rd-party APIs (OpenID providers included) or slow database queries.
293 Properly run Memcached (within the same LAN) is fast and not a blocker.
294 Slow I/O on POSIX filesystems only includes a few operations, namely
295 on UNIX domain sockets and named pipes. Nearly all other operations
296 on POSIX filesystems can be considered "fast", or at least
299 WriterThread{Pool,Spawn} will require thread safety if your response
300 body is dynamically generated during the body#each call.
302 %h2 middlewares and frameworks
309 %a(href="Rainbows/DevFdResponse.html") DevFdResponse
311 %a(href="Rainbows/AppPool.html") AppPool
313 %a(href="http://rdoc.info/gems/rack/Rack/Lock") Rack::Lock
320 %td.async lots of RAM :P
326 %td.async Revactor itself
332 %td.async thread-safe Ruby
338 %td.async DevFdResponse
344 %td.async thread-safe Ruby
350 %td.async async_sinatra, Cramp, rack-fiber_pool
352 %td.mod CoolioThreadSpawn
356 %td.async thread-safe Ruby
362 %td.async Rainbows::Fiber::IO, Rainbows.sleep
368 %td.async Rainbows::Fiber::IO, Rainbows.sleep
374 %td.async thread-safe Ruby
380 %td.async NeverBlock, async_sinatra
382 %td.mod CoolioThreadPool
386 %td.async Coolio, thread-safe Ruby
388 %td.mod CoolioFiberSpawn
392 %td.async Coolio, Rainbows::Fiber::IO, Rainbows.sleep
394 %td.mod WriterThreadPool
398 %td.async thread-safe Ruby in response body only
400 %td.mod WriterThreadSpawn
404 %td.async thread-safe Ruby in response body only
410 %td.async DevFdResponse
416 %td.async DevFdResponse
418 %td.mod XEpollThreadPool
422 %td.async thread-safe Ruby
424 %td.mod XEpollThreadSpawn
428 %td.async thread-safe Ruby
431 "No!" means it's fundamentally incompatible, use an
432 %a(href="Rainbows/AppPool.html") AppPool
436 NeverBlock also supports a :pool_size option which is one less
437 layer of complexity than using AppPool.
439 NeverBlock can neuter the Mutex class so Rack::Lock effectively
440 becomes a no-op with:
442 %code require "never_block/frameworks/rails"
443 (before Rails is loaded)
445 Everything that's DevFdResponse-compatible can use it for passing
446 async responses through