November 2013
Intermediate to advanced
148 pages
3h 12m
English
So far we’ve worked with two major message-passing patterns; first we looked at publish/subscribe, then request/reply. There’s one more pattern offered by ØMQ that’s sometimes good to use with Node.js—PUSH/PULL.
The PUSH and PULL socket types are useful when you have a queue of jobs that you want to fairly assign among a pool of available workers.
Recall that with a PUB/SUB pair, each subscriber will receive all messages sent by the publisher. In a PUSH/PULL setup, only one puller will receive each message sent by the pusher.
So PUSH will round-robin-distribute messages to connected sockets, just like the DEALER. But unlike the DEALER/ROUTER flow, there is no backchannel. A message traveling ...
Read now
Unlock full access