lib/griffin/server.rb in griffin-0.1.3 vs lib/griffin/server.rb in griffin-0.1.4
- old
+ new
@@ -12,13 +12,20 @@
GRACEFUL_SHUTDOWN = '0'
FORCIBLE_SHUTDOWN = '1'
class << self
- def run
+ # @param bind [String]
+ # @param port [Integer,String]
+ def run(bind: nil, port: nil)
c = config_builder.build
- Griffin::Engine.start(c, cluster: Integer(c[:workers]) > 1)
+ if c[:services].empty?
+ raise 'Required at least one service to handle reqeust'
+ end
+
+ opts = { bind: bind, port: port }.compact
+ Griffin::Engine.start(c.merge(opts), cluster: Integer(c[:workers]) > 1)
end
def configure
yield(config_builder)
end
@@ -92,13 +99,11 @@
# nothing
end
end
end
+ # Need Timeout?
@thread_pool.shutdown
- # unless @sever.session_count == 0
- # end
-
@command.close
@signal.close
end
def handle_command