examples/echo_worker.rb in pigato-0.4.3 vs examples/echo_worker.rb in pigato-0.4.4
- old
+ new
@@ -5,33 +5,30 @@
#require "pigato"
def start
ts = []
- (0..5).each do |tid|
+ (0..10).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
+ #sleep 0.1
end
}
end
ts.each do |to|
to.join
end
end
-(0..1).each do |pid|
+(0..4).each do |pid|
fork do
start
end
end