[zeromq-dev] cancel czmq timers by id

Michael Haberler mail17 at mah.priv.at
Wed Nov 20 10:03:16 CET 2013


Am 20.11.2013 um 09:58 schrieb Chris Laws <clawsicus at gmail.com>:

> Many of my system's (CZMQ based) applications are long running, though some applications within my system come and go. Many applications do various timer based work when certain applications are present and should not be doing these timer actions when certain applications are not present. Consequently, I have a need to be able to cancel certain timers (but not all timers) throughout the lifetime of my applications without stopping all of the application timers.
> 
> The current zloop timer implementation makes this difficult for me because it cancels all timers that match the 'arg'. Typically the 'arg' is the application context structure containing useful references to application data and state. In my case it is always the 'arg' and I would think that this is pretty standard usage too.
> 
> I've submitted pull request #318 (https://github.com/zeromq/czmq/pull/318) to create a conversation topic regarding the changes contained within, which change the behaviour such that timers can be cancelled using their timer_id. I've been using this code successfully for some time now and the czmq_selftest indicates that there are no leaks. Ideally I'd like this functionality present in czmq, pending no significant issues, objections or show stoppers. As Pieter points out, this constitutes an API change.
> 
> This implementation fits well with the event-reactor style applications I create that typically finalise and terminate upon exit of the event loop. Perhaps this implementation might not fit so well with other styles?
> 
> Thoughts? Would this type of change help or hinder you?

yes it would help - finer grained control is a definite plus

- Michael

> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev




More information about the zeromq-dev mailing list