Git Product home page Git Product logo

Comments (7)

brycekahle avatar brycekahle commented on August 17, 2024 1

So after a bunch of investigation, this appears to be a problem with libuv not firing a callback when a read is ready. The tests only check sub.bind then pub.connect, but I need pub.bind then sub.connect because I will have multiple subscribers.

I found a nasty workaround that seems to work consistently. If you add a sub.read() call immediately after connect(), it seems to force the socket into a working state.

var sub = zmq.socket('sub');
sub.on('message', handler);
sub.connect('inproc://internal');
// make sure to handle the return value in case you actually get a message
var msg = sub.read();
if (msg) {
  sub._emitMessage(msg);
}

from zeromq.node.

JustinTulloss avatar JustinTulloss commented on August 17, 2024

There's a long discussion on inproc pub/sub here: http://lists.zeromq.org/pipermail/zeromq-dev/2010-November/008005.html. Does that answer any of your questions?

from zeromq.node.

stelcheck avatar stelcheck commented on August 17, 2024

I have this problem too: the problem you mention seems to be connected with threading, however here we do not use multithread so I don't think this is related.

Perhaps it could still be a zeromq problem?

Edit:

It also does not seem to work with IPC

Reedit:

NM, works with ipc

from zeromq.node.

blalor avatar blalor commented on August 17, 2024

I also have the inproc and pub/sub problem. Same code works fine when the transport's switched to tcp, but with inproc the subscriber never receives the message. I'm actually using pub -> xsub -> xpub -> sub; the pub -> xsub bit works fine (and I can also see the subscription getting created), but the message sent via xpub.send(…) never reaches the sub socket. This is with the current master and ZeroMQ 3.2.2.

from zeromq.node.

jedi4ever avatar jedi4ever commented on August 17, 2024
  • In the tests , there is also a pub/sub using inproc, and that one succeeds. (with a hack of the timeout).
  • in the above example pub & sub are doing the inverse as in the test (pub = bind, sub = connect).
  • in my testing both sub & pub connect to an xpub/xsub and I hit the same problem as above (tcp works but inproc not)

from zeromq.node.

its2mc avatar its2mc commented on August 17, 2024

Yo has anyone solved this issue? I am trying to make an app, and my thinking is that an inproc socket connection will be faster than a tcp socket. Since speed and resource efficiency is a factor i'd like to try out xpub/xsub as blalor... can this be solved?

from zeromq.node.

its2mc avatar its2mc commented on August 17, 2024

Or can I have my xpub on tcp while the xsub on inproc?

from zeromq.node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.