Sha256: da60acde5be916c8e55e861aa8b9a732a57d504a351a8b2b8eea83675ce883db
Contents?: true
Size: 581 Bytes
Versions: 1
Compression:
Stored size: 581 Bytes
Contents
#!/usr/bin/env ruby require "rubygems" require "#{File.dirname(__FILE__)}/../lib/pigato.rb" #require "pigato" def start ts = [] (0..5).each do |tid| ts << Thread.new { worker = Pigato::Worker.new('tcp://127.0.0.1:55555', 'echo') worker.start loop do request = worker.recv if !request.nil? worker.reply request else sleep 0.1 end sleep 40 worker.start end } end ts.each do |to| to.join end end (0..1).each do |pid| fork do start end end Process.waitall
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pigato-0.4.3 | examples/echo_worker.rb |