From d6e4975937a9590f48dc39b1a4aefa9d62f34616 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 5 Jan 2011 16:38:46 -0800 Subject: rainbows.rb: unindent --- lib/rainbows.rb | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) (limited to 'lib/rainbows.rb') diff --git a/lib/rainbows.rb b/lib/rainbows.rb index 5d9c02f..f0b5a23 100644 --- a/lib/rainbows.rb +++ b/lib/rainbows.rb @@ -59,36 +59,35 @@ module Rainbows autoload :EvCore, 'rainbows/ev_core' autoload :SocketProxy, 'rainbows/socket_proxy' - class << self - - # Sleeps the current application dispatch. This will pick the - # optimal method to sleep depending on the concurrency model chosen - # (which may still suck and block the entire process). Using this - # with the basic :Coolio or :EventMachine models is not recommended. - # This should be used within your Rack application. - def sleep(nr) - case G.server.use - when :FiberPool, :FiberSpawn - Rainbows::Fiber.sleep(nr) - when :RevFiberSpawn, :CoolioFiberSpawn - Rainbows::Fiber::Coolio::Sleeper.new(nr) - when :Revactor - Actor.sleep(nr) - else - Kernel.sleep(nr) - end + # Sleeps the current application dispatch. This will pick the + # optimal method to sleep depending on the concurrency model chosen + # (which may still suck and block the entire process). Using this + # with the basic :Coolio or :EventMachine models is not recommended. + # This should be used within your Rack application. + def self.sleep(nr) + case G.server.use + when :FiberPool, :FiberSpawn + Rainbows::Fiber.sleep(nr) + when :RevFiberSpawn, :CoolioFiberSpawn + Rainbows::Fiber::Coolio::Sleeper.new(nr) + when :Revactor + Actor.sleep(nr) + else + Kernel.sleep(nr) end + end - # runs the Rainbows! HttpServer with +app+ and +options+ and does - # not return until the server has exited. - def run(app, options = {}) # :nodoc: - HttpServer.new(app, options).start.join - end + # runs the Rainbows! HttpServer with +app+ and +options+ and does + # not return until the server has exited. + def self.run(app, options = {}) # :nodoc: + HttpServer.new(app, options).start.join + end - # :stopdoc: + # :stopdoc: + class << self attr_accessor :max_bytes, :keepalive_timeout - # :startdoc: end + # :startdoc: # the default max body size is 1 megabyte (1024 * 1024 bytes) @max_bytes = 1024 * 1024 -- cgit v1.2.3-24-ge0c7