Simply empty the receive queues every time you read (do a non blocking recv until there's no message), and keep the message that's most useful to you (e.g. the latest one).
On Wed, Jul 2, 2014 at 6:11 PM, Martin Townsend <[email protected]> wrote: > Hi, > > I want to use the pub/sub pattern for interprocess communication. > Basically I have one application reading measurements and then posts it > to a number of other processes at a fixed rate of every 500 milliseconds. > > One of the subscribing processes is only interested in reading every 2 > seconds. As it queues you get a time lag. I tried setting the > ZMQ_RCVHWM socket option to 1 to just drop old messages but this doesn't > work. I suppose I could just create the socket, read the current > message and tear it down but I was wondering if there is a better way or > should I just be using some other IPC like shared memory? > > Best Regards, > Martin. > > _______________________________________________ > zeromq-dev mailing list > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
