nng
nng copied to clipboard
Give tutorials on how to implement common ZMQ patterns
I'm a zmq user, currently evaluating nng for a new project. It turned out to be a rather frustrating experience. I spent two hours searching on the web and reading the manuals of nng, still unsure how to implement the common router-dealer load-balancing pattern in nng (simple round-robin distribution in req/rep
or push/pull
is not enough in many real world cases). Some mailing-list post suggested to use device
with rep/req
, but the details are vague: For example, where to put the custom load-balancing logic? Does the identity
frame (or more generally, the message format) work like in zmq?
So i think it would be great if some tutorials or guides on how to implement the common zmq patterns can be provided. Through this way, the nng-way of doing things can be demonstrated clearly
I have a similar request or just a question in fact. How would someone implement a 'fan out' socket, that given a queue of messages will distribute them out to each worker in turn? This is the sort of thing I'm think of http://zguide.zeromq.org/page:all#Divide-and-Conquer.
Ignore this message. I just realised you have an example 'pipeline' in the getting started page.
I hava the same question,How can I implement the ZMQ'S ROUTER/DEALER with NNG?
use nng_device? There is any sample code or doc? thx!
If I understand correctly, NNG's REP is analog to ROUTER when in raw mode or using a context object for asynchronous operations. REQ is similarly analog to DEALER when in raw mode or using a context object. So these socket types are unnecessary... I presume that the same reasoning applies to the lack of XPUB/XSUB in NNG.
Raw mode is used for forwarding. And it works with all protocols. Including pub / sub.
See nng_device.
getting started page
Sorry, where is this "getting started" page? I can't find any mention of it in the README.md
, docs/
, the official website or via a web search.