require "al_worker_program" require "al_worker_tcp" class Worker1 < AlWorker def initialize2() @pgm = Program.new( "sleep", "10" ) @tcp = Tcp.new() @tcp.run( self ) end def tcp_sleep( sock, param ) result = @pgm.run sock.puts result ? " SUCCESS" : " FAIL" return true end def tcp_alive( sock, param ) sock.puts @pgm.alive? ? " ALIVE" : " DEAD" return true end def tcp_kill( sock, param ) result = @pgm.kill sock.puts result ? " SUCCESS" : " FAIL" return true end end server = Worker1.new() server.daemon()