[zeromq-dev] zyre questions
Pieter Hintjens
ph at imatix.com
Sun Feb 8 11:13:32 CET 2015
Hi Kalyan,
For inter-thread communication you can use zyre with its gossip
discovery. There's an example in zyre_test ().
Every message (ENTER, SHOUT, WHISPER) has the UUID address of the
sender. You can use this to WHISPER back to it.
Typically if you want to identify nodes in other ways you can add a
header (zyre_set_header) and check this in the ENTER message.
You cannot do a blocking request-response, really. You'd process
events from peers, and wait for the one you expect. Almost the same.
This may become heavy, though I'd definitely explore this even as an exercise.
An alternative to using Zyre could be to use inproc endpoints for
discovery, e.g. bind to a free endpoint in some range, and then
connect to all possible endpoints. It depends on how many threads you
have and how often you start/stop them.
-Pieter
On Sun, Feb 8, 2015 at 10:46 AM, Kalyan Bade <kalyanbade at gmail.com> wrote:
> Hi folks,
>
> I am new to zmq/czmq and zyre. Please pardon me if these questions are too
> basic.
>
> I am trying to use zyre for inter-thread communication and discovery of
> nodes. Each thread doesn't have the prior knowledge of which thread it needs
> to communicate to. So instead of maintaining my own mesh of messaging nodes
> (threads) and their discovery, I went with zyre. I hope its not way off from
> its intended usage.
>
> I could get the multicast (group) messaging work fine. But I am stuck with
> unicast messages using zyre_whisper. The API is expecting the peer's UUID as
> an argument. How do I get that information? I have the peer name available.
> Is there a way to get to peer UUID given its name?
>
> Also, another requirement is to support blocking request response. Is there
> a way to achieve this using zyre basic primitives. I see that zyre_whisper()
> is a non blocking send. Please correct me if my assumptions are not right
> and provide guidance on the right usage.
>
> I really appreciate any help on this..
>
> Thanks
> Kalyan
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
More information about the zeromq-dev
mailing list