[zeromq-dev] How many messages are in queue now?
Pieter Hintjens
ph at imatix.com
Fri Apr 17 10:53:16 CEST 2015
It was never possible, due to the fact that pipes are being written
and read asynchronously. You cannot measure the free space except by
stopping everything.
The workaround is to use credit based flow control. I've a section in
the Guide that explains how this works. You can in effect know what %
of the pipe from sender to receiver (including all ZeroMQ and network
buffers) is filled.
-Pieter
On Wed, Apr 15, 2015 at 4:30 PM, Ilja Golshtein <ilejncs at narod.ru> wrote:
> Hello.
>
> I used to think that it is possible to retrieve number or queued messages per socket in recent versions of 0mq, while I failed to find correspond getsockopt in 4.0.5
>
> Use case: I need to alter behavior of my application (drop certain type of messages) if a queue is, say, 90% of HWM.
>
> Please, advise if this facility is implemented or planned, or suggest a workaround which is more elegant than having atomic variable (it is inproc) maintained by reader and writer threads which is what I plan to do.
>
> Thanks.
>
> --
> Best regards
> Ilja Golshtein
> _______________________________________________
> 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