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.

classification
Title: asyncio.streams.FlowControlMixin should be part of the API
Type: Stage: resolved
Components: asyncio Versions: Python 3.7
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, xitop, yselivanov
Priority: normal Keywords:

Created on 2018-10-15 17:27 by xitop, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (5)
msg327764 - (view) Author: (xitop) Date: 2018-10-15 17:27
This issue report is based on a SO question "How to create asyncio stream reader/writer for stdin/stdout?", its answer and comments. Link: https://stackoverflow.com/q/52089869/5378816

The key point is that two unidirectional pipes should be used the same way as one bidirectional network socket. The answer (more precisely the Linux/Unix part of it) and some following comments - both created by highly competent SO members - suggest that FlowControlMixin is a useful class required to write a proper code for this and similar usecases.

That's why the FlowControlMixin or an equivalent should be made available to asyncio programmers as a documented part of the library.
msg327765 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-10-15 17:36
asvetlov: need to handle this usecase with the new API; -1 on exposing FlowControlMixin though.
msg327771 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2018-10-15 18:12
1. Trio has *stappled* streams for the case, especially useful for starting TLS session over stdin/stdout.
We can master something too.
2. FlowControlMixin was always considered a **private** API. Would be nice to add an underscore prefix to the name if not too late. IIRC the official policy is: if you need the class -- copy and paste it into your project.
3. Even a person with very many stars on StackOverflow doesn't become an asyncio expert automatically; while I very respect the sie and so on.
msg343685 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2019-05-27 20:18
FlowControlMixing is a private API class.
The class is not intended for the usage outside of asyncio.
If you found it useful for you please feel free to copy-paste the class from asyncio sources into your project.

The reason is: we want to keep freedom for changing asyncio internals without breaking backward compatibility.
One of key technologies for it is keeping the public API as small as possible.
msg343686 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2019-05-27 20:19
#36889 deprecates using FlowXontrolMixin outside of asyncio
History
Date User Action Args
2022-04-11 14:59:07adminsetgithub: 79174
2019-05-27 20:19:02asvetlovsetmessages: + msg343686
2019-05-27 20:18:17asvetlovsetstatus: open -> closed
resolution: rejected
messages: + msg343685

stage: resolved
2018-10-15 18:12:53asvetlovsetmessages: + msg327771
2018-10-15 17:36:32yselivanovsetmessages: + msg327765
2018-10-15 17:27:55xitopcreate