class Wamp::Worker::Runner::Base
This is a base class for all of the runners
Attributes
dispatcher[R]
name[R]
Public Class Methods
new(name, uuid: nil)
click to toggle source
Constructor
@param name [Symbol] - the name of the worker
# File lib/wamp/worker/runner.rb, line 15 def initialize(name, uuid: nil) # Initialize the dispatcher @name = name || :default @dispatcher = Proxy::Dispatcher.new(self.name, uuid: uuid) @active = false end
Public Instance Methods
_start()
click to toggle source
region Override Methods
# File lib/wamp/worker/runner.rb, line 51 def _start end
_stop()
click to toggle source
# File lib/wamp/worker/runner.rb, line 54 def _stop end
active?()
click to toggle source
Returns if the runner is active
# File lib/wamp/worker/runner.rb, line 30 def active? @active end
logger()
click to toggle source
Returns the logger
# File lib/wamp/worker/runner.rb, line 24 def logger Wamp::Worker.logger end
start()
click to toggle source
Starts the runner
# File lib/wamp/worker/runner.rb, line 36 def start return if self.active? @active = true self._start end
stop()
click to toggle source
Stops the runner
# File lib/wamp/worker/runner.rb, line 44 def stop return unless self.active? self._stop @active = false end