Sha256: 7d3c8dfce475b660b7ff3e4c9659d025190835d2b80ef3aff0efee7bc32c0fbf

Contents?: true

Size: 494 Bytes

Versions: 11

Compression:

Stored size: 494 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_recv do |message|
    puts "Receiver 2 #{message.body}"
  end
  zmq_pull(z_addr, :connect).on_recv do |message|
    puts "Receiver 1 #{message.body}"
  end
  push = zmq_push(z_addr, :bind)

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
dripdrop-0.8.1 example/pushpull.rb
dripdrop-0.8.0 example/pushpull.rb
dripdrop-0.7.1 example/pushpull.rb
dripdrop-0.6.0 example/pushpull.rb
dripdrop-0.5.0 example/pushpull.rb
dripdrop-0.4.2 example/pushpull.rb
dripdrop-0.4.1 example/pushpull.rb
dripdrop-0.4.0 example/pushpull.rb
dripdrop-0.3.1 example/pushpull.rb
dripdrop-0.3.0 example/pushpull.rb
dripdrop-0.2.0 example/pushpull.rb