[issue23236] asyncio: add timeout to StreamReader read methods

2018-09-19 Thread STINNER Victor


STINNER Victor  added the comment:

This feature request doesn't seem popular and I lost track of it, so I just 
close the issue. Sorry.

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23236] asyncio: add timeout to StreamReader read methods

2016-04-20 Thread Alexander Mohr

Alexander Mohr added the comment:

any updates on this?  I think this would be perfect for 
https://github.com/aio-libs/aiobotocore/issues/31

--
nosy: +thehesiod

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23236] asyncio: add timeout to StreamReader read methods

2015-01-13 Thread STINNER Victor

STINNER Victor added the comment:

Copy of the feature requets by Guido van Rossum:
https://code.google.com/p/tulip/issues/detail?id=96

Often you want to stop servicing (or using) a connection when there is no 
activity in a given time.  You can do this by wrapping all your read calls in 
wait_for(), but a single readline() or readexactly() call may do multiple I/O 
operations and typically you want to reset the timeout whenever you receive 
some more bytes.  So it makes more sense to either add the timeout to the 
various read*() calls, or even to (optionally) set it in the constructor, so 
that the class can implement a more subtle timeout algorithm.

I could imagine an overall timeout too, and possibly even something that gives 
up if the bandwidth goes below a threshold, to avoid waiting forever on a huge 
download.

(For StreamWriter I think it's sufficient to call wait_for(w.drain()), so I 
think this only applies to StreamReader.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23236] asyncio: add timeout to StreamReader read methods

2015-01-13 Thread STINNER Victor

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com