rainbows/rev/* require/autoload cleanup
[rainbows.git] / lib / rainbows / rev.rb
blob6ddb130542a7fc55aaaa942f57d5ac3b0138aa87
1 # -*- encoding: binary -*-
2 require 'rev'
3 Rev::VERSION >= '0.3.0' or abort 'rev >= 0.3.0 is required'
5 # Implements a basic single-threaded event model with
6 # {Rev}[http://rev.rubyforge.org/].  It is capable of handling
7 # thousands of simultaneous client connections, but with only a
8 # single-threaded app dispatch.  It is suited for slow clients and
9 # fast applications (applications that do not have slow network
10 # dependencies) or applications that use DevFdResponse for deferrable
11 # response bodies.  It does not require your Rack application to be
12 # thread-safe, reentrancy is only required for the DevFdResponse body
13 # generator.
15 # Compatibility: Whatever \Rev itself supports, currently Ruby
16 # 1.8/1.9.
18 # This model does not implement as streaming "rack.input" which
19 # allows the Rack application to process data as it arrives.  This
20 # means "rack.input" will be fully buffered in memory or to a
21 # temporary file before the application is entered.
23 module Rainbows::Rev
24   # :stopdoc:
25   # keep-alive timeout scoreboard
26   KATO = {}
28   # all connected clients
29   CONN = {}
31   if {}.respond_to?(:compare_by_identity)
32     CONN.compare_by_identity
33     KATO.compare_by_identity
34   end
36   autoload :Master, 'rainbows/rev/master'
37   autoload :ThreadClient, 'rainbows/rev/thread_client'
38   autoload :DeferredChunkResponse, 'rainbows/rev/deferred_chunk_response'
39   # :startdoc:
40 end
41 # :enddoc:
42 require 'rainbows/rev/heartbeat'
43 require 'rainbows/rev/server'
44 require 'rainbows/rev/core'
45 require 'rainbows/rev/deferred_response'
46 require 'rainbows/rev/client'
47 Rainbows::Rev.__send__ :include, Rainbows::Rev::Core