globally refactor Range handling for responses
[rainbows.git] / lib / rainbows / coolio.rb
blobd0b8b2e1c2b60c5b75642a1f2c0b6e0af8053421
1 # -*- encoding: binary -*-
2 require 'rainbows/coolio_support'
4 # Implements a basic single-threaded event model with
5 # {Cool.io}[http://coolio.github.com/].  It is capable of handling
6 # thousands of simultaneous client connections, but with only a
7 # single-threaded app dispatch.  It is suited for slow clients and
8 # fast applications (applications that do not have slow network
9 # dependencies) or applications that use DevFdResponse for deferrable
10 # response bodies.  It does not require your Rack application to be
11 # thread-safe, reentrancy is only required for the DevFdResponse body
12 # generator.
14 # Compatibility: Whatever Cool.io itself supports, currently Ruby
15 # 1.8/1.9.
17 # This model does not implement as streaming "rack.input" which
18 # allows the Rack application to process data as it arrives.  This
19 # means "rack.input" will be fully buffered in memory or to a
20 # temporary file before the application is entered.
21 module Rainbows::Coolio
22   # :stopdoc:
23   # keep-alive timeout scoreboard
24   KATO = {}
26   # all connected clients
27   CONN = {}
29   if {}.respond_to?(:compare_by_identity)
30     CONN.compare_by_identity
31     KATO.compare_by_identity
32   end
34   autoload :Client, 'rainbows/coolio/client'
35   autoload :Master, 'rainbows/coolio/master'
36   autoload :ThreadClient, 'rainbows/coolio/thread_client'
37   autoload :ResponsePipe, 'rainbows/coolio/response_pipe'
38   autoload :ResponseChunkPipe, 'rainbows/coolio/response_chunk_pipe'
39   # :startdoc:
40 end
41 # :enddoc:
42 require 'rainbows/coolio/heartbeat'
43 require 'rainbows/coolio/server'
44 require 'rainbows/coolio/core'
45 Rainbows::Coolio.__send__ :include, Rainbows::Coolio::Core