[zeromq-dev] Publish / Subscribe vs Multicast

Martin Sustrik sustrik at 250bpm.com
Tue Feb 16 21:59:19 CET 2010


gonzalo diethelm wrote:

> Ok. Can you explain what the interfaces for this will look like? As a
> preview?

It's already in docs.

To set a limit you can do following:

int64_t hwm = 100;
zmq_setsockopt (s, ZMQ_HWM, &hwm, sizeof (hwm));

That means each connection can absorb at most 100 unprocessed messages. 
If the limit is hit, no new messages will be sent to the connection.

>>> 3. It would be nice if zmq_sleep() took milliseconds instead of
> seconds
>>> as a parameter.
>> Yeah. It would be nice. However, I am not sure whether all the
> platforms
>> we are running on support usleep... to be investigated.
> 
> Linux and Windows do. What other platforms are supported currently?
> Isn't the whole world running on Linux by now? ;-)

We are supporting quite a lot of different UNIX platforms (OSX, HP-UX, 
various flavours of BSD etc.)

>>> When I get back to the office, I will finish the butterfly tutorial.
>> !
> 
> I did finish it. It took me a while to understand the usage rules for
> bind and connect. As Martin mentioned in a previous message:
> 
>> The endpoint that should handle multiple connections (server) should
> bind,
>> while the one that handles only a single connection (client) connects.
> 
> This rule works no matter if you are actively initiating a connection or
> passively waiting for it; if you handle multiple connections, you MUST
> bind.
> 
> Anyway, I have a working butterfly tutorial (which is rather small);
> component1 and component2 where subsumed into a single component (since
> they only differ in their endpoints), and I use zmq_streamer as the
> intermediate component. I also have a bash script to launch the programs
> in several combinations, to test how the message throughput varies as
> predicted by theory (it does). If anybody is interested in me doing
> something with it, please let me know.
> 
> One final note: working on this tutorial made me realize how easy and
> powerful ZMQ is. I can now think about butterfly in the Java world, and
> maybe come closer to my specific needs.

:)

Anyway, as for the example it's valuable to have as many of them as 
possible. If you are going to write java version of the example, it 
would be even more helpful as there is no Java example available so far. 
However, even if you stick to C example, it's worth of publishing.

The best way to handle this would be to create a repo on github (or any 
similar service of your choice) and then link it from 0MQ website.

Thoughts?

Martin




More information about the zeromq-dev mailing list