[zeromq-dev] PUB/SUB question with IPC
Pieter Hintjens
ph at imatix.com
Wed Jul 2 18:16:18 CEST 2014
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
<martin.townsend at xsilon.com> 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
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list