Sha256: d0c5d145da5cb0964886c5f8e740220cf5609b1b1fc306ad05dbc9ab805bdad5
Contents?: true
Size: 984 Bytes
Versions: 22
Compression:
Stored size: 984 Bytes
Contents
module Kuroko2 module Workflow module Processor def initialize @hostname = Socket.gethostname @stop = ServerEngine::BlockingFlag.new @processing = ServerEngine::BlockingFlag.new @workflow = Workflow::Engine.new end def run Kuroko2.logger = logger Kuroko2.logger.info "[#{@hostname}-#{worker_id}] Start Workflow::Processor" until @stop.wait(1.0) unless @processing.set? begin @processing.set! @workflow.process_all @processing.reset! end end end rescue Exception => e Kuroko2.logger.fatal("[#{@hostname}-#{worker_id}] #{e.class}: #{e.message}\n" + e.backtrace.map { |trace| " #{trace}" }.join("\n")) raise e end def stop Kuroko2.logger.info "[#{@hostname}-#{worker_id}] Stop Workflow::Processor" @stop.set! end end end end
Version data entries
22 entries across 22 versions & 1 rubygems