tests: "wc -c" portability for *BSDs
[rainbows.git] / lib / rainbows / coolio.rb
bloba993060aaf9d3f965cb88910e9be238cddf713ae
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.
22 # This model is mostly compatible with users of "async.callback" in
23 # the Rack environment as long as they do not depend on EventMachine.
25 # === RubyGem Requirements
26 # * cool.io 1.0.0 or later
27 module Rainbows::Coolio
28   # :stopdoc:
29   # keep-alive timeout scoreboard
30   KATO = {}
32   # all connected clients
33   CONN = {}
35   if {}.respond_to?(:compare_by_identity)
36     CONN.compare_by_identity
37     KATO.compare_by_identity
38   end
40   autoload :Client, 'rainbows/coolio/client'
41   autoload :Master, 'rainbows/coolio/master'
42   autoload :ThreadClient, 'rainbows/coolio/thread_client'
43   autoload :ResponsePipe, 'rainbows/coolio/response_pipe'
44   autoload :ResponseChunkPipe, 'rainbows/coolio/response_chunk_pipe'
45   autoload :Heartbeat, 'rainbows/coolio/heartbeat'
46   # :startdoc:
47 end
48 # :enddoc:
49 require 'rainbows/coolio/server'
50 require 'rainbows/coolio/core'
51 Rainbows::Coolio.__send__ :include, Rainbows::Coolio::Core