Comments (7)
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.
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.
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.
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.
- 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.
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.
Or can I have my xpub on tcp while the xsub on inproc?
from zeromq.node.
Related Issues (20)
- ZMQ msg len in push-pull socket is zero? HOT 1
- Queue stats - memory usage, queue length etc
- Client-server pattern implementation (ZMQ_CLIENT)
- Expose zmq_z85_encode and zmq_z85_decode HOT 2
- Support for building zeromq with yarn instead of npm HOT 3
- Mark this project as unmaintained in favor of zeromq/zeromq.js HOT 13
- Cannot use ZeroMQ 4.2 sockopt ZMQ_ROUTER_HANDOVER HOT 1
- fatal error: zmq.h: No such file or directory HOT 4
- How to receive messages with multiple frames
- Confused between zmq and zeromq HOT 2
- hyperledger-sawtooth error
- How does Monitor Interval effect REQ/REP PUB/SUB network traffic? HOT 1
- zmq.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 59. This version of Node.js requires NODE_MODULE_VERSION 54. HOT 3
- node 10 install issue HOT 2
- How do we include zeromq so we can bundle the Node application? HOT 1
- router/dealer proxy doesn't forward multipart msgs correctly
- Facing zmq router timeout issue HOT 1
- Dish/Radio Support?
- zmq.socket is not a function HOT 5
- The test fails on PowerPC ppc64le architecture
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zeromq.node.