Author vstinner
Recipients ajaborsk, gvanrossum, vstinner, yselivanov
Date 2014-07-11.20:46:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
>  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:43vstinnersetrecipients: + vstinner, gvanrossum, yselivanov, ajaborsk
2014-07-11 20:46:43vstinnersetmessageid: <>
2014-07-11 20:46:43vstinnerlinkissue21962 messages
2014-07-11 20:46:43vstinnercreate