November 2013
Intermediate to advanced
148 pages
3h 12m
English
The REQ/REP socket pair we explored makes request/reply logic easy to code by operating sequentially. A given requester or responder will only ever be aware of one message at a time. For parallel message processing, ØMQ includes the more advanced socket types ROUTER and DEALER. Let’s explore these a bit; then we’ll be ready to construct our Node.js cluster.
You can think of a ROUTER socket as a parallel REP socket. Rather than replying to only one message at a time, a ROUTER socket can handle many requests simultaneously. It remembers which connection each request came from and will route reply messages accordingly.
Recall from Implementing a Messaging Protocol, that any time you do networked programming, ...
Read now
Unlock full access