This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients ajaborsk, gvanrossum, vstinner, yselivanov
Date 2014-07-11.20:46:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405111603.47.0.51544496624.issue21962@psf.upfronthosting.co.za>
In-reply-to
Content
>  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.
History
Date User Action Args
2014-07-11 20:46:43vstinnersetrecipients: + vstinner, gvanrossum, yselivanov, ajaborsk
2014-07-11 20:46:43vstinnersetmessageid: <1405111603.47.0.51544496624.issue21962@psf.upfronthosting.co.za>
2014-07-11 20:46:43vstinnerlinkissue21962 messages
2014-07-11 20:46:43vstinnercreate