Class: Nsqcd::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/nsqcd/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(worker_classes, opts = {}) ⇒ Runner

Returns a new instance of Runner.



6
7
8
# File 'lib/nsqcd/runner.rb', line 6

def initialize(worker_classes, opts={})
  @runnerconfig = RunnerConfig.new(worker_classes, opts)
end

Instance Method Details

#runObject



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

def run
  @se = ServerEngine.create(nil, WorkerGroup) { @runnerconfig.reload_config! }
  @se.run
end

#stopObject



15
16
17
# File 'lib/nsqcd/runner.rb', line 15

def stop
  @se.stop
end