[zeromq-dev] removing poller from zloop

Mohit Jaggi mohitjaggi at gmail.com
Sun Mar 30 06:52:56 CEST 2014


Pieter, Thanks for confirming the API contract.
It turns out that there was no problem in the zloop. I was using
java.util.concurrentq's size() function to see if I have any workers
available and if not I would remove the poller. The "bug" was in this API,
it is "weakly consistent" according to its documentation. I replaced it
with a regular queue (I had already removed other threads, so did not need
concurrency) and the code started to behave correctly then.


On Sun, Mar 23, 2014 at 1:33 PM, Pieter Hintjens <ph at imatix.com> wrote:

> Normally they won't get delivered to your handler after removing the
> poller.
>
> Can you make a reproducible test case and then debug what's happening
> in zloop, yourself?
>
> On Sun, Mar 23, 2014 at 7:47 PM, Mohit Jaggi <mohitjaggi at gmail.com> wrote:
> > Hi Folks,
> > I am wondering if removing a poller from a zloop works
> "instantaneously". I
> > suspect I am getting a message on frontend after calling (using JZMQ
> > binding)
> >
> > loop.removePoller(new PollItem(frontend, 0));
> >
> > Is it possible that some messages are in frontend queue when I remove it
> > from loop and they get "delivered" to my handler later? My code is based
> on
> > the load balancing pattern in Zguide which assumes that this never
> happens.
> >
> > Mohit.
> >
> >
> > _______________________________________________
> > zeromq-dev mailing list
> > zeromq-dev at lists.zeromq.org
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140329/607753ed/attachment.htm>


More information about the zeromq-dev mailing list