On Tue, Feb 15, 2011 at 9:14 PM, Michael Kogan
<[email protected]>wrote:

> I have a question regarding a pub/sub messaging bus and how 0mq integrates
> with Java threads.
> I have a thread for each sub socket with a poller (using the ZMQForwarder
> as a template), and it seems that I may be wasting resources. I would much
> prefer those threads to just wait on data, however, unless native java
> synchronized access , the .recv() method cannot be interrupted by a
> controller, so I am not sure how that thread would be cleaned up hmm cleanly
> without using polling to periodically check if it needs to exit.
> Any thoughts or suggestion from the experts?
>

I would imagine that you could do something like add another zeromq socket
for control messages, and poll for them both - then have a separate thread
that will catch the interruption and send a shutdown type message (or
whatever you want it to do) to your subs.

Ian
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to