require "al_worker_message" require "al_worker_tcp" class AlWorker1 < AlWorker def initialize2() @bc = BroadcastMessage.new() @tcp = Tcp.new.run( self ) end def tcp_send( sock, param ) @bc.send( param[""] ) return true end def tcp_a_recv( sock, param ) @bc.attach() loop { message = @bc.receive() sock.puts message } ensure @bc.detach() end end AlWorker1.new.run