Calling OCaml-wrapped ZeroMQ code from signal handler

There are two potential problems: Inside a signal handler, you can only call asynchronous signal safe functions. Most functions are not async signal safe. The reason for the restriction is that a function could be called in the middle of the same function’s execution. Thus, internal state could be corrupted. Very few functions are async … Read more

Memory leak when emitting messages with Socket.IO + Node.js + ZMQ

NodeJs may be use Windows Socket API ( which include memory leaks , old known bug ) https://connect.microsoft.com/VisualStudio/feedback/details/605621/winsock-c-program-causes-memory-leak The problem is the WSACleanup will never be called until you shutdown the network services. ( Mixing up ZMq or Nodejs won’t change that fact ) Now, over the time, you will lock more pages of memory … Read more

Differences between ZeroMQ and WebSockets

A: Real-Time-Messaging is a nice tag, however You may soon realise, that once going into the territory of Real-Time, there is no justification for spending clock-cycles on wrapping any message into the XHTML-Matrjoska-in-Another-Matrjoska-inside-another-Matrjoska alike envelopes-inside-envelopes and associated inefficiencies. Real-Time struggles to operate in real time, so to spend/lose a minimum achievable time necessary to process … Read more

ZeroMQ vs Crossroads I/O

Crossroads.io is pretty dead since Martin Sustrik has started on a new stack, in C, called nano: https://github.com/250bpm/nanomsg Crossroads.io does not, afaik, implement ZMTP/1.0 nor ZMTP/2.0 but its own version of the protocol. Nano has pluggable transports and we’ll probably make a ZMTP transport for that. Nano is really nice, a rethinking of the original … Read more

ZeroMQ/ZMQ Push/Pull pattern usefulness

It’s not a load balancer, this was a faulty explanation that stayed in the 0MQ docs for a while. To do load-balancing, you have to get some information back from the workers about their availability. PUSH, like DEALER, is a round-robin distributor. It’s useful for its raw speed, and simplicity. You don’t need any kind … Read more

How does zmq poller work?

When you need to listen on different sockets in the same thread, use a poller: ZMQ.Socket subscriber = ctx.socket(ZMQ.SUB) ZMQ.Socket puller = ctx.socket(ZMQ.PULL) Register sockets with poller (POLLIN listens for incoming messages) ZMQ.Poller poller = ZMQ.Poller(2) poller.register(subscriber, ZMQ.Poller.POLLIN) poller.register(puller, ZMQ.Poller.POLLIN) When polling, use a loop: while( notInterrupted()){ poller.poll() //subscriber registered at index ‘0’ if( poller.pollin(0)) … Read more

What are zeromq use cases?

Let’s say you want to have a bulletin board of some kind. You want to allow only some people to see it, by subscribing to the bulleting board. This can be done using the publisher/subscriber model of ZeroMQ. Now, let’s say you need to send some asynchronous messages. That is, when a message is sent … Read more

grpc and zeromq comparsion

async req / res communication (inproc or remote) between nodes Both libraries allow for synchronous or asynchronous communication depending on how to implement the communication. See this page for gRPC: http://www.grpc.io/docs/guides/concepts.html. Basically gRPC allow for typical HTTP synchronous request/response or a ‘websocket-like’ bidirectional streaming. For 0mq you can setup a simple REQ-REP connection which is … Read more

Why use AMQP/ZeroMQ/RabbitMQ

what makes them better than writing your own library? When rolling out the first version of your app, probably nothing: your needs are well defined and you will develop a messaging system that will fit your needs: small feature list, small source code etc. Those tools are very useful after the first release, when you … Read more