Sha256: d29e7138605aff795df542dc5e4da9aba525a66fe05a97f3d5de5bb46cab8f7e

Contents?: true

Size: 439 Bytes

Versions: 2

Compression:

Stored size: 439 Bytes

Contents

#!/usr/bin/env ruby

require "rubygems"
require "#{File.dirname(__FILE__)}/../lib/pigato.rb"
#require "pigato"

ts = []

[0, 1, 2, 3, 4, 5, 6].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
    end
  }
end

ts.each do |to|
  to.join
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pigato-0.3.1 examples/echo_worker.rb
pigato-0.3.0 examples/echo_worker.rb