1

I have a problem with dnode. I created a node.js server and from ruby I want to call some node function. It works, but the connection hangs. So I placed some console.log to the node.js function to debug the problem and I can see that the function is called 3times (I am calling it 3times) but after that the code in ruby is blocked. Look at this:

dnode = DNode.new({}).connect(9293) do |remote, connection|
  remote.publish('123312', 'room', {:foo => 'bar'})
  remote.publish('123312', 'room', {:foo => 'bar'})
  remote.publish('123312', 'room', {:foo => 'bar'})
end

1000.times {Benchmark::dnode}

As you can see I am making a benchmark. the publish method is called just 3times (one run) not 30000 times and the benchmark just hanging. I was looking at dnode for another languages and they uses in this case remote.end but this method is not part of the object.

Thank you!

Jakub
  • 1,037
  • 8
  • 21

0 Answers0