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

Plan: async Iterator #287

Open
Tracked by #279 ...
tmandry opened this issue Mar 7, 2023 · 2 comments
Open
Tracked by #279 ...

Plan: async Iterator #287

tmandry opened this issue Mar 7, 2023 · 2 comments
Assignees
Milestone

Comments

@tmandry
Copy link
Member

tmandry commented Mar 7, 2023

This is a roadmap item for wg-async. You can view the roadmap here: https://github.com/orgs/rust-lang/projects/28

Write a short doc on the kind of design we expect, and open questions, on this topic (#280).

@tmandry tmandry added this to the Async 2023 milestone Mar 7, 2023
@tmandry tmandry added the roadmap-topic Top-line goal for the roadmap label Mar 7, 2023
This was referenced Mar 7, 2023
@tmandry tmandry removed the roadmap-topic Top-line goal for the roadmap label Mar 9, 2023
@tmandry
Copy link
Member Author

tmandry commented Apr 28, 2023

Update: Still need to write out how this doesn't block async fn in trait.

Main concerns are around cancel-safety and poll_next vs next, but these shouldn't interact with AFIT.

We also need some discussion of how to migrate to a LendingIterator (supertrait) or GAT-ify the existing Iterator trait. No known interactions with AFIT here.

@yoshuawuyts
Copy link
Member

Main concerns are around cancel-safety and poll_next vs next, but these shouldn't interact with AFIT.

I've written an in-depth analysis of how both approaches compare here: https://blog.yoshuawuyts.com/async-iterator-trait. Basing our async traits on AFITs seems like it's clearly the superior direction.

While knowing that basing async iterator on AFITs works well, we also need a strategy for how to integrate it into the stdlib. For that reason we should probably this work on "effect-generic trait declarations". As well as consider not just adding the "async iterator" trait by itself, but re-RFC it to include a full story describing "async iteration".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

3 participants