From a35fd37ff0c81ca8130c18b7b77957bafe686f83 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 26 Dec 2010 03:00:11 +0000 Subject: rev: unindent, needless autoload Deferred* classes will get loaded anyways since Rainbows::Rev::Client hit them in case statements. --- lib/rainbows/rev.rb | 65 +++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/lib/rainbows/rev.rb b/lib/rainbows/rev.rb index 1ee705c..71bcfcc 100644 --- a/lib/rainbows/rev.rb +++ b/lib/rainbows/rev.rb @@ -2,43 +2,40 @@ require 'rainbows/rev/core' require 'rainbows/rev/client' -module Rainbows +# Implements a basic single-threaded event model with +# {Rev}[http://rev.rubyforge.org/]. It is capable of handling +# thousands of simultaneous client connections, but with only a +# single-threaded app dispatch. It is suited for slow clients and +# fast applications (applications that do not have slow network +# dependencies) or applications that use DevFdResponse for deferrable +# response bodies. It does not require your Rack application to be +# thread-safe, reentrancy is only required for the DevFdResponse body +# generator. +# +# Compatibility: Whatever \Rev itself supports, currently Ruby +# 1.8/1.9. +# +# This model does not implement as streaming "rack.input" which +# allows the Rack application to process data as it arrives. This +# means "rack.input" will be fully buffered in memory or to a +# temporary file before the application is entered. - # Implements a basic single-threaded event model with - # {Rev}[http://rev.rubyforge.org/]. It is capable of handling - # thousands of simultaneous client connections, but with only a - # single-threaded app dispatch. It is suited for slow clients and - # fast applications (applications that do not have slow network - # dependencies) or applications that use DevFdResponse for deferrable - # response bodies. It does not require your Rack application to be - # thread-safe, reentrancy is only required for the DevFdResponse body - # generator. - # - # Compatibility: Whatever \Rev itself supports, currently Ruby - # 1.8/1.9. - # - # This model does not implement as streaming "rack.input" which - # allows the Rack application to process data as it arrives. This - # means "rack.input" will be fully buffered in memory or to a - # temporary file before the application is entered. +module Rainbows::Rev - module Rev + # :stopdoc: + # keep-alive timeout scoreboard + KATO = {} - # :stopdoc: - # keep-alive timeout scoreboard - KATO = {} + # all connected clients + CONN = {} - # all connected clients - CONN = {} - - if {}.respond_to?(:compare_by_identity) - CONN.compare_by_identity - KATO.compare_by_identity - end - - autoload :DeferredResponse,'rainbows/rev/deferred_response' - autoload :DeferredChunkResponse,'rainbows/rev/deferred_chunk_response' - include Core - # :startdoc: + if {}.respond_to?(:compare_by_identity) + CONN.compare_by_identity + KATO.compare_by_identity end + + include Rainbows::Rev::Core + # :startdoc: end +require 'rainbows/rev/deferred_response' +require 'rainbows/rev/deferred_chunk_response' -- cgit v1.2.3-24-ge0c7