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

The bane of async generators #57

Open
goodboy opened this issue Feb 17, 2019 · 0 comments
Open

The bane of async generators #57

goodboy opened this issue Feb 17, 2019 · 0 comments

Comments

@goodboy
Copy link
Owner

goodboy commented Feb 17, 2019

As per #56, discussion on gitter, and discussion in python-trio/trio#638 async generators aren't task safe and cause all sorts of subtle problems if used without some kind of higher level wrapping to conduct teardown, that is an explicit aclose() call. This issue is mostly to keep track of the long running discussion and eventually integrate whatever consensus solution is chosen.

For now I've implemented a custom ReceiveChannel as a stopgap but even it isn't sufficient to address premature stream break-ing/teardown currently. I would like to experiment with using an contextlib.AsyncExitStack to ensure, at least at the actor nursery level, aclose() is always called on all streams.

The effort on this general front includes quite a few issues worth watching:

@goodboy goodboy changed the title trio wrappers for async generators? The bane of async generators Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant