Class: SnowmanIO::Launcher
- Inherits:
-
Object
- Object
- SnowmanIO::Launcher
- Includes:
- Celluloid
- Defined in:
- lib/snowman-io/launcher.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Launcher
constructor
A new instance of Launcher.
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(options) ⇒ Launcher
Returns a new instance of Launcher.
5 6 7 |
# File 'lib/snowman-io/launcher.rb', line 5 def initialize() @options = end |
Instance Method Details
#start ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/snowman-io/launcher.rb', line 9 def start Migration.new.migrate app = Rack::Cascade.new [API::Root, Web] @web_server = WebServer.supervise_as(:web_server, app, @options.slice(:port, :host, :verbose)) @main = Loop::Main.supervise_as(:main) @checks = Loop::Checks.supervise_as(:checks) @spiders = Loop::Spiders.supervise_as(:checks) end |
#stop ⇒ Object
18 19 20 21 22 23 |
# File 'lib/snowman-io/launcher.rb', line 18 def stop @spiders.terminate @checks.terminate @main.terminate @web_server.terminate # TODO: shutdown blocking? end |