Sha256: e43d693c91194da41cf5a832ca177e586f2ae3838d9d5a4ea441fe103b987dff

Contents?: true

Size: 583 Bytes

Versions: 15

Compression:

Stored size: 583 Bytes

Contents

require 'dripdrop/node'
Thread.abort_on_exception = true

DripDrop::Node.new do
  addr = 'http://127.0.0.1:2200'
  
  i = 0 
  http_server(addr).on_recv do |msg,response|
    i += 1
    response.send_message(msg)
  end

  EM::PeriodicTimer.new(1) do
    client = http_client(addr)
    msg = DripDrop::Message.new('http/status', :body => "Success #{i}")
    client.send_message(msg) do |resp_msg|
      puts resp_msg.inspect
    end
  end

  #Keep zmqmachine from spinning around using up all our CPU by creating a socket
  req = zmq_xreq('tcp://127.0.0.1:2091', :connect)
end.start!

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
dripdrop-0.9.6 example/http.rb
dripdrop-0.9.5 example/http.rb
dripdrop-0.9.4 example/http.rb
dripdrop-0.9.3 example/http.rb
dripdrop-0.9.2 example/http.rb
dripdrop-0.8.1 example/http.rb
dripdrop-0.8.0 example/http.rb
dripdrop-0.7.1 example/http.rb
dripdrop-0.6.0 example/http.rb
dripdrop-0.5.0 example/http.rb
dripdrop-0.4.2 example/http.rb
dripdrop-0.4.1 example/http.rb
dripdrop-0.4.0 example/http.rb
dripdrop-0.3.1 example/http.rb
dripdrop-0.3.0 example/http.rb