[zeromq-dev] Event-driven publish-subscribe model

Chuck Remes lists at chuckremes.com
Mon Mar 26 18:53:46 CEST 2012


On Mar 26, 2012, at 11:08 AM, Ian Barber wrote:

> 
> 
> On Mon, Mar 26, 2012 at 4:42 PM, Chuck Remes <lists at chuckremes.com> wrote:
> That is a far better mechanism than the built-in HWM mechanism. Since it isn't built in to the library, you would have to add this logic at the application level. Since it *requires* two-way communication between the client and server, you cannot use the PUB/SUB sockets. You would need to use DEALER/ROUTER sockets to handle this communication.
> 
> Yes, this will be a little more work but it is necessary for the kind of flexibility that your #2 issue requires.
> 
> I think you can still use PUB/SUB here, if you're doing at-least-one kind of flow control you just need credit from *someone*, not everyone, and you could do that with a simple pull or rep socket - as soon as anyone adds credit, then you push the message out the pub. This is actually pretty much just a send-on-ack sliding window, but with multiple clients. Doesn't need to be a library level, that's an easy bit of code in application land. By doing the checking in app land you also get the opportunity to be clever - for example, rolling up messages if they supersede each other, that kind of thing. 

Yes, this is true. I answered assuming that the OP wanted to work with just a single set of sockets rather than having a "side channel" for communicating the credit flows. Either way will work, so it's up to the OP to figure out which way makes more sense to him.

cr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120326/a551eb56/attachment.htm>


More information about the zeromq-dev mailing list