Sha256: 80b4d106d11b960276ec7a109b2bdc3f4f9c93dd7e17426c4fd8643659a8dddc

Contents?: true

Size: 548 Bytes

Versions: 2

Compression:

Stored size: 548 Bytes

Contents

#!/usr/bin/env ruby

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

ts = []

[0,1,2,3,4,5,6].each do |tid|
  ts << Thread.new {
    client = Pigato::Client.new('tcp://127.0.0.1:55555')
    client.start

    requests = 10000
    d1 = Time.now
    requests.times do |i|
      begin
        client.request('echo', 'Hello world1')
      end
    end
    d2 = Time.now
    puts "#{requests} requests/replies processed (#{(d2 - d1) * 1000} milliseconds)"
  }
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_client.rb
pigato-0.3.0 examples/echo_client.rb