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-0.8 perf/pub_sub/remote.rb
rbczmq-0.7 perf/pub_sub/remote.rb
rbczmq-0.6 perf/pub_sub/remote.rb
rbczmq-0.5 perf/pub_sub/remote.rb
rbczmq-0.4 perf/pub_sub/remote.rb
rbczmq-0.3 perf/pub_sub/remote.rb
rbczmq-0.2 perf/pub_sub/remote.rb
rbczmq-0.1 perf/pub_sub/remote.rb