[zeromq-dev] REQ-REP Timeouts in PyZMQ

Benjamin benjamin.l.cordes at gmail.com
Fri Nov 21 15:27:24 CET 2014


The default value is -1 (infinite). Not quite sure what you mean with
threads. If you run a socket in in the main thread that should work.
PyzMQ supports greenlets, if that's what you need. Usually each thread
has it's own context.

On Fri, Nov 21, 2014 at 3:19 PM, Dustin Webb <daemonmaker at gmail.com> wrote:
> Is it necessary to do polling? I would prefer the client simply wait
> indefinitely. I also notice that the example solution uses threads which I
> was hoping to avoid for simplicity.
>
>
> On Fri Nov 21 2014 at 09:10:20 Benjamin <benjamin.l.cordes at gmail.com> wrote:
>>
>> Hi,
>>
>> here is an example with polling:
>> https://github.com/imatix/zguide/blob/master/examples/Python/asyncsrv.py
>> So the client raises an exception after a pre-defined time-period (1
>> second e.g.)
>>
>> Check out the socket options here
>> http://api.zeromq.org/4-1:zmq-setsockopt   (ZMQ_RCVTIMEO and
>> ZMQ_SNDTIMEO)
>>
>> On Fri, Nov 21, 2014 at 2:25 PM, Dustin Webb <daemonmaker at gmail.com>
>> wrote:
>> > Greetings everyone,
>> >
>> > I have recently written a train_extension for Pylearn2 that uses PyZMQ
>> > to
>> > let me query for data from my experiments. My train_extension works in
>> > conjunction with a client that queries for the data and plots the
>> > response.
>> > The train_extension receives and responds to requests for data after
>> > each
>> > training epoch. However these training epochs can take a long time to
>> > run,
>> > e.g. any where from minutes to hours in the normal cases. As such I'm
>> > wondering about timeout behavior. Put simply, will the connections
>> > timeout?
>> > And if so, under what conditions and how will the timeouts manifest? In
>> > other words, will the send on the client raise a TimeOut exception after
>> > a
>> > certain period of time? And on the server side, what will happen to a
>> > request that was received hours earlier?
>> >
>> > Thanks in advance,
>> > Dustin Webb
>> > Undefined Intelligence
>> > Algorithmic Robotics Lab
>> > Laboratoire d'Informatique des Systemes Adaptatifs
>> >
>> > _______________________________________________
>> > zeromq-dev mailing list
>> > zeromq-dev at lists.zeromq.org
>> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>> >
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
> _______________________________________________
> 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