Sha256: 85ec250931f1cf21df7213dc29ece682dac05916ffe01d57c454e58c00ff9d95

Contents?: true

Size: 491 Bytes

Versions: 28

Compression:

Stored size: 491 Bytes

Contents

# encoding: utf-8

ctx = ZMQ::Context.new
pub = ctx.socket(:PUB);
pub.bind($runner.endpoint);

msg = $runner.payload

start_time = Time.now
$runner.msg_count.times do
  case $runner.encoding
  when :string
    pub.send(msg)
  when :frame
    pub.send_frame(ZMQ::Frame(msg))
  when :message
    m =  ZMQ::Message.new
    m.pushstr "header"
    m.pushstr msg
    m.pushstr "body"
    pub.send_message(m)
  end
end

puts "Sent #{$runner.msg_count} messages in %ss ..." % (Time.now - start_time)

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
rbczmq-1.7.9 perf/pub_sub/remote.rb
rbczmq-1.7.8 perf/pub_sub/remote.rb
rbczmq-1.7.7 perf/pub_sub/remote.rb
rbczmq-1.7.6 perf/pub_sub/remote.rb
rbczmq-1.7.5 perf/pub_sub/remote.rb
rbczmq-1.7.4 perf/pub_sub/remote.rb
rbczmq-1.7.3 perf/pub_sub/remote.rb
rbczmq-1.7.2 perf/pub_sub/remote.rb
rbczmq-1.7.1 perf/pub_sub/remote.rb
rbczmq-1.7.0 perf/pub_sub/remote.rb
rbczmq-1.6.4 perf/pub_sub/remote.rb
rbczmq-1.6.2 perf/pub_sub/remote.rb
rbczmq-1.6 perf/pub_sub/remote.rb
rbczmq-1.5 perf/pub_sub/remote.rb
rbczmq-1.4 perf/pub_sub/remote.rb
rbczmq-1.3 perf/pub_sub/remote.rb
rbczmq-1.2 perf/pub_sub/remote.rb
rbczmq-1.1 perf/pub_sub/remote.rb
rbczmq-1.0 perf/pub_sub/remote.rb
rbczmq-0.9 perf/pub_sub/remote.rb