class Emque::Consuming::CommandReceivers::Base

Attributes

thread[R]

Public Instance Methods

restart() click to toggle source
# File lib/emque/consuming/command_receivers/base.rb, line 9
def restart
  stop if running?
  start
end
start() click to toggle source
# File lib/emque/consuming/command_receivers/base.rb, line 14
def start
  raise NotImplemented
end
status() click to toggle source
# File lib/emque/consuming/command_receivers/base.rb, line 23
def status
  thread ? (thread.status || "stopped") : "stopped"
end
stop() click to toggle source
# File lib/emque/consuming/command_receivers/base.rb, line 18
def stop
  thread.exit if running?
  status
end

Private Instance Methods

running?() click to toggle source
# File lib/emque/consuming/command_receivers/base.rb, line 31
def running?
  thread && !thread.stop?
end