Sha256: e1f45203ca3d4c358558157e2482b46edd62650966a4ff533ad1cbefd8dfbb9a

Contents?: true

Size: 492 Bytes

Versions: 2

Compression:

Stored size: 492 Bytes

Contents

require 'dripdrop/node'
Thread.abort_on_exception = true

DripDrop::Node.new do
  z_addr = 'tcp://127.0.0.1:2200'
   
  zmq_pull(z_addr, :connect).on_receive do |message|
    puts "Receiver 2 #{message.body}"
  end
  zmq_pull(z_addr, :connect).on_receive do |message|
    puts "Receiver 1 #{message.body}"
  end
  push = zmq_push(z_addr, :bind)

  i = 0
  EM::PeriodicTimer.new(1) do
    i += 1
    puts i
    push.send_message(:name => 'test', :body => "Test Payload #{i}")
  end
end.start!

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dripdrop-0.11.0-java example/pushpull.rb
dripdrop-0.11.0 example/pushpull.rb