On 11/10/2013 09:12 PM, Bruno D. Rodrigues wrote:
> I'm unable to test this but as I see a sleep 0.5 and a constant delay
> increase of 1sec I'd suggest the receiver to instead of sleeping a
> fixed time, to poll, with a timeout value until the next tick. That
> way if the receive and your code takes 0.75s, the poll can Sleep only
> Up to 0.25s, but more importamtly, consume the Messages already on the
> air.
> 

Indeed, what you say is perfectly right. But in my case I'm interested in 
simulating a slow receiver (one of many, and that's why it waits so much) while 
the producer is very fast and produces at variable rates.
In my mind, the slow receiver should receive a packet, do its job (which in the 
real case can take a random time up to a few seconds), and do another receive 
when it's ready again.
With a HWM set at 1 packet, I would expect the receiver to always get the most 
fresh package (well, 2 packages 'ago' if one is queued server side and one 
client side), but as my demo proves, instead packets are not dropped as 
expected but there is a very long queue forming somewhere.

I'm trying to understand whether this is the expected behavior or if indeed 
there is a problem either with zmq or with my code (where the latter is by far 
the most probable, of course).

Thanks for your help!

Cheers,
Samuele

-- 
|--
| Samuele Carli
|--
| Contacts:
|
|       Home page   : www.csspace.net
|       E-mail      : carlisamuele _at_ csspace.net
|       Icq         : 60401601
|       Skype       : wohthan
|       jabber/gtalk: [email protected] (no emails here!)
|--
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to