class SnowmanIO::Launcher

Public Class Methods

new(options) click to toggle source
# File lib/snowman-io/launcher.rb, line 5
def initialize(options)
  @options = options
end

Public Instance Methods

start() click to toggle source
# 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() click to toggle source
# File lib/snowman-io/launcher.rb, line 18
def stop
  @spiders.terminate
  @checks.terminate
  @main.terminate
  @web_server.terminate # TODO: shutdown blocking?
end