[Python-ideas] [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted (original) (raw)
Guido van Rossum guido at python.org
Wed Jan 9 05:50:32 CET 2013
- Previous message: [Python-ideas] [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted
- Next message: [Python-ideas] [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, Jan 8, 2013 at 8:31 PM, Guido van Rossum <guido at python.org> wrote:
On Tue, Jan 8, 2013 at 5:14 PM, Yuriy Taraday <yorik.sar at gmail.com> wrote:
- pause() and resume() work with reading only, so they should be suffixed (prefixed) with read(ing), like pausereading(), resumereading(). Agreed.
I think I want to take that back. I think it is more common for a protocol to want to pause the transport (i.e. hold back data_received() calls) than it is for a transport to want to pause the protocol (i.e. hold back write() calls). So the more common method can have a shorter name. Also, pause_reading() is almost confusing, since the protocol's method is named data_received(), not read_data(). Also, there's no reason for the protocol to want to pause the write (send) actions of the transport -- if wanted to write less it should not have called write(). The reason to distinguish between the two modes of pausing is because it is sometimes useful to "stack" multiple protocols, and then a protocol in the middle of the stack acts as a transport to the protocol next to it (and vice versa). See the discussion on this list previously, e.g. http://mail.python.org/pipermail/python-ideas/2013-January/018522.html (search for the keyword "stack" in this long message to find the relevant section).
-- --Guido van Rossum (python.org/~guido)
- Previous message: [Python-ideas] [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted
- Next message: [Python-ideas] [Python-Dev] PEP 3156 - Asynchronous IO Support Rebooted
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]