Sha256: cf08ecfa7350c4d4b4699fc3502d8197fbf046e5a7c8aeeb3a7996b0fed7c15a
Contents?: true
Size: 864 Bytes
Versions: 2
Compression:
Stored size: 864 Bytes
Contents
module Shoryuken class Launcher include Celluloid include Util trap_exit :actor_died attr_accessor :manager def initialize @manager = Shoryuken::Manager.new_link @fetcher = Shoryuken::Fetcher.new_link(manager) @done = false manager.fetcher = @fetcher end def stop(options = {}) watchdog('Launcher#stop') do @done = true @fetcher.terminate if @fetcher.alive? manager.async.stop(shutdown: !!options[:shutdown], timeout: Shoryuken.options[:timeout]) manager.wait(:shutdown) end end def run watchdog('Launcher#run') do manager.async.start end end def actor_died(actor, reason) return if @done logger.warn 'Shoryuken died due to the following error, cannot recover, process exiting' exit 1 end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
shoryuken-0.0.4 | lib/shoryuken/launcher.rb |
shoryuken-0.0.3 | lib/shoryuken/launcher.rb |