[zeromq-dev] pub-sub timers

Matt Weinstein mattweinstein at gmail.com
Wed Aug 4 16:02:37 CEST 2010


I have a need for a bunch of different resolutions for zeromq  
timeouts, relatively jittery is fine, for things like request timeouts  
heartbeats etc.

I'll use a cheap phase locked ms timing source using usleep (adjusts  
every once in a while to realtime) or whatever is efficient.

The fun part is the messages:

Every ms, send "1", except
Every 10 ms send "10", except
Every 100 ms send "100"
Etc

So the stream looks like  (starting from 1 :-) ):

1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 ... 10 1 1 1 1 1 1 1 1 1  
100 1 1 1 1 1 1 1 1 1 10 1 ...

If you need milliseconds subs to "1", it will pick up all the messages
If you need 10 milliseconds subs to "10", it will pick up 10's 100's  
et al
Etc

I'll be using this to drive some zmq_reactors  of course :-)

Enjoy,

Best
Matt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Sketch 2010-08-04 08_57_15.jpg
Type: image/jpeg
Size: 39393 bytes
Desc: not available
URL: <http://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100804/cc3a0641/attachment.jpg>
-------------- next part --------------



More information about the zeromq-dev mailing list