Sha256: 8f6c957a030e78d093f40940bc5fbe914a554873ebb4c047cf084eedd71f3ebf
Contents?: true
Size: 595 Bytes
Versions: 5
Compression:
Stored size: 595 Bytes
Contents
require 'eventmachine' require 'socket' class WorkerWatcher < EventMachine::ProcessWatch def initialize(options = {}) @pid = options[:pid] @stdout = options[:stdout] @stderr = options[:stderr] @reply_exchange = options[:reply_exchange] end def process_exited ignored, status = Process::waitpid2 @pid if status.exitstatus != 0 reply = {:type => :crash, :hostname => Socket.gethostname, :stdout => @stdout.read, :stderr => @stderr.read} @reply_exchange.publish(Yajl::Encoder.encode(reply)) end end end
Version data entries
5 entries across 5 versions & 1 rubygems