[zeromq-dev] A query about implementing aborts in request reply broker
Ian Barber
ian.barber at gmail.com
Wed Jul 18 21:00:12 CEST 2012
On Mon, Jul 16, 2012 at 11:17 AM, aalok sood <aalok at ideadevice.com> wrote:
> Thanks for your suggestion Ian.
>
> I have a similar model in place, but the issue is how do I find out how
> many responses are going to come in on my pull socket.
>
> In essence, can I somehow find out how many backend workers are connected
> to my broker.
>
>
There is no easy way to do that - the idea with pub sub is that you
generally want to send a message to everyone and no worry precisely about
who the subscribers are. In your case, it might be better to have a REQ-REP
model - clients make a REQ when they're ready to do some work, your server
has a ROUTER and you track the ids, and you send out a message to each one
when you have something to do, then you can track the state internally. If
you wanted to keep the pub/pull model, you could have a worker send a
message to the pull saying that they are starting some work, and use that
to track the number you expect. Of course, you have to consider the
possibility of worker failure - so if a worker starts a job then dies, what
is you action going to be around that, both in the regular and cancellation
cases.
Ian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120718/78d690c1/attachment.htm>
More information about the zeromq-dev
mailing list