module Hat::Wrapper

Public Class Methods

new() click to toggle source
# File lib/hat/wrapper.rb, line 4
def initialize
  logger.debug "Initializing wrapper for #{@worker_id}"
  @stop_flag = ServerEngine::BlockingFlag.new
end

Public Instance Methods

run() click to toggle source
# File lib/hat/wrapper.rb, line 9
def run
  logger.debug "Starting worker #{@worker_id}"
  config[:worker].id     = @worker_id
  config[:worker].logger = logger
  config[:worker].run
  until @stop_flag.set? do
    sleep 0.1
  end
end
stop() click to toggle source
# File lib/hat/wrapper.rb, line 19
def stop
  @stop_flag.set!
end