Sha256: 1e35399aed9d2b37585f141d72733e27539bf5d71071c755061ac66ec32f7713

Contents?: true

Size: 486 Bytes

Versions: 12

Compression:

Stored size: 486 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
  EM::PeriodicTimer.new(1) do
    i += 1
    puts i
    push.send_message(:name => 'test', :body => "Test Payload #{i}")
  end
end.start!

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dripdrop-0.10.0 example/pushpull.rb
dripdrop-0.10.0-java example/pushpull.rb
dripdrop-0.10.0.beta2 example/pushpull.rb
dripdrop-0.10.0.beta1 example/pushpull.rb
dripdrop-0.9.10 example/pushpull.rb
dripdrop-0.9.9 example/pushpull.rb
dripdrop-0.9.8 example/pushpull.rb
dripdrop-0.9.6 example/pushpull.rb
dripdrop-0.9.5 example/pushpull.rb
dripdrop-0.9.4 example/pushpull.rb
dripdrop-0.9.3 example/pushpull.rb
dripdrop-0.9.2 example/pushpull.rb