Class: Shoryuken::Launcher

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/shoryuken/launcher.rb

Instance Method Summary collapse

Methods included from Util

#elapsed, #fire_event, #logger, #unparse_queues, #worker_name

Constructor Details

#initializeLauncher

Returns a new instance of Launcher.



5
6
7
8
# File 'lib/shoryuken/launcher.rb', line 5

def initialize
  @manager = Shoryuken::Manager.new(Shoryuken::Fetcher.new,
                                    Shoryuken.options[:polling_strategy].new(Shoryuken.queues))
end

Instance Method Details

#runObject



15
16
17
# File 'lib/shoryuken/launcher.rb', line 15

def run
  @manager.start
end

#stop(options = {}) ⇒ Object



10
11
12
13
# File 'lib/shoryuken/launcher.rb', line 10

def stop(options = {})
  @manager.stop(shutdown: !options[:shutdown].nil?,
                timeout: Shoryuken.options[:timeout])
end