New submission from STINNER Victor: Attached patch adds an optional timeout parameter to the read(), read_exactly() and readline() methods of StreamReader.
If a single read takes longer than timeout seconds, a asyncio.TimeoutError is raised. The timeout is reset each time new data is received. Read data is pushed back to the StreamReader buffer if the wait raises an exception (timeout, cancelled, etc.), so it's possible to retry the read later. ---------- components: asyncio files: streamreader_timeout.patch keywords: patch messages: 233978 nosy: gvanrossum, haypo, yselivanov priority: normal severity: normal status: open title: asyncio: add timeout to StreamReader read methods versions: Python 3.4, Python 3.5 Added file: http://bugs.python.org/file37697/streamreader_timeout.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23236> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com