Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asyncio.streams.FlowControlMixin should be part of the API #79174

Closed
xitop mannequin opened this issue Oct 15, 2018 · 5 comments
Closed

asyncio.streams.FlowControlMixin should be part of the API #79174

xitop mannequin opened this issue Oct 15, 2018 · 5 comments
Labels

Comments

@xitop
Copy link
Mannequin

xitop mannequin commented Oct 15, 2018

BPO 34993
Nosy @asvetlov, @1st1

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2019-05-27.20:18:17.036>
created_at = <Date 2018-10-15.17:27:55.153>
labels = ['3.7', 'expert-asyncio']
title = 'asyncio.streams.FlowControlMixin should be part of the API'
updated_at = <Date 2019-05-27.20:19:02.813>
user = 'https://bugs.python.org/xitop'

bugs.python.org fields:

activity = <Date 2019-05-27.20:19:02.813>
actor = 'asvetlov'
assignee = 'none'
closed = True
closed_date = <Date 2019-05-27.20:18:17.036>
closer = 'asvetlov'
components = ['asyncio']
creation = <Date 2018-10-15.17:27:55.153>
creator = 'xitop'
dependencies = []
files = []
hgrepos = []
issue_num = 34993
keywords = []
message_count = 5.0
messages = ['327764', '327765', '327771', '343685', '343686']
nosy_count = 3.0
nosy_names = ['asvetlov', 'yselivanov', 'xitop']
pr_nums = []
priority = 'normal'
resolution = 'rejected'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue34993'
versions = ['Python 3.7']

@xitop
Copy link
Mannequin Author

xitop mannequin commented Oct 15, 2018

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.

@xitop xitop mannequin added 3.7 (EOL) end of life topic-asyncio labels Oct 15, 2018
@1st1
Copy link
Member

1st1 commented Oct 15, 2018

asvetlov: need to handle this usecase with the new API; -1 on exposing FlowControlMixin though.

@asvetlov
Copy link
Contributor

  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.

@asvetlov
Copy link
Contributor

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.

@asvetlov
Copy link
Contributor

bpo-36889 deprecates using FlowXontrolMixin outside of asyncio

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
marmarek added a commit to marmarek/qubes-app-linux-split-gpg2 that referenced this issue Dec 18, 2024
It's not recommended to use it directly, but copy into own project, so
do just that. See python/cpython#79174
marmarek added a commit to marmarek/qubes-app-linux-split-gpg2 that referenced this issue Dec 21, 2024
It's not recommended to use it directly, but copy into own project, so
do just that. See python/cpython#79174
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants