Class: MultipleMan::Runner

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/multiple_man/runner.rb

Defined Under Namespace

Classes: ShutDown

Constant Summary collapse

MODES =
[:general, :seed].freeze

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Runner

Returns a new instance of Runner.

Raises:

  • (ArgumentError)


10
11
12
13
14
# File 'lib/multiple_man/runner.rb', line 10

def initialize(options = {})
  @mode = options.fetch(:mode, :general)

  raise ArgumentError, "undefined mode: #{mode}" unless MODES.include?(mode)
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
23
# File 'lib/multiple_man/runner.rb', line 16

def run
  trap_signals!
  preload_framework!
  channel.prefetch(prefetch_size)
  build_listener.listen
rescue ShutDown
  connection.close
end