Message222794
> A timeout can be specified for the whole task using asyncio.wait_for() but it's tricky.
Exactly, you can use wait_for() on any async operation. Why would you like to add a timeout on each async operation, while wait_for() is available?
Replace event.wait(timeout=60) with wait_for(event.wait(), 60).
Maybe we should put more examples using wait_for() on operations commonly used with a timeout?
Guido proposed to add a timeout for some operations, but with a different meaning: maximum time without getting new events, each new event resets the timeout. It was maybe on StreamReader.readline() which uses multiple async read until it gets a full line. |
|
Date |
User |
Action |
Args |
2014-07-11 20:46:43 | vstinner | set | recipients:
+ vstinner, gvanrossum, yselivanov, ajaborsk |
2014-07-11 20:46:43 | vstinner | set | messageid: <1405111603.47.0.51544496624.issue21962@psf.upfronthosting.co.za> |
2014-07-11 20:46:43 | vstinner | link | issue21962 messages |
2014-07-11 20:46:43 | vstinner | create | |
|