lib/saorin/adapters/servers/reel.rb in saorin-0.1.3 vs lib/saorin/adapters/servers/reel.rb in saorin-0.1.4
- old
+ new
@@ -7,15 +7,17 @@
class Reel < Base
DEFAULT_HEADERS = {
'Content-Type' => 'application/json'
}.freeze
+ attr_reader :server
+
def initialize(handler, options = {}, &block)
super handler, options
- server = ::Reel::Server.supervise(options[:host], options[:port], &method(:process))
- trap(:INT) { server.terminate; exit }
- sleep
+ @server = ::Reel::Server.supervise(options[:host], options[:port], &method(:process))
+ trap(:INT) { @server.terminate; exit }
+ sleep unless options[:nonblock]
end
def process(connection)
while request = connection.request
case request