Sha256: baff7ff5e9f1e9648fbaab1ce3b81a3f1dd5206be06351eda22209ab716d47fe

Contents?: true

Size: 624 Bytes

Versions: 6

Compression:

Stored size: 624 Bytes

Contents

module SnowmanIO
  class Launcher
    include Celluloid

    def initialize(options)
      @options = options
    end

    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

    def stop
      @spiders.terminate
      @checks.terminate
      @main.terminate
      @web_server.terminate # TODO: shutdown blocking?
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
snowman-io-0.5.1 lib/snowman-io/launcher.rb
snowman-io-0.5.0 lib/snowman-io/launcher.rb
snowman-io-0.4.0 lib/snowman-io/launcher.rb
snowman-io-0.3.1 lib/snowman-io/launcher.rb
snowman-io-0.3.0 lib/snowman-io/launcher.rb
snowman-io-0.2.0 lib/snowman-io/launcher.rb