proposal-async-iterator-helpers icon indicating copy to clipboard operation
proposal-async-iterator-helpers copied to clipboard

Current status as of 2024-06

Open bakkot opened this issue 8 months ago • 18 comments

I'll be presenting on the current status of the proposal to the committee next week, and figured I'd post here so people watching this repo can follow along. Here's my slides.

Specifically, my current plan is to include the bare minimum in this, and explore the space of unordered helpers (#7, #20) in a followup. That is, I'm planning to include

  • order-preserving .map, .filter, .flatMap, .toAsync, all supporting concurrent calls to their .next.
  • .buffered(N) for doing such calls.
  • All the other helpers from sync Iterator, with no additional affordances for concurrency (except maybe .drop, #1).

Notably I am not planning to include any helpers for doing concurrent forEach (and friends), nor any helpers for doing out-of-order concurrency. The latter means you will not be able to get optimal concurrency for all problems just using the things in this proposal, but it will still be better than nothing, and I'm intending for the design to leave room for multiple possible directions for unordered helpers (e.g., .map is allowed to resolve promises out-of-order, which leaves room for utilities like .bufferUnordered).

If the committee approves of this "minimal viable helpers" direction, I'll spec it and propose for advancement as soon as I can (though the next two months will be hectic for me so it may not happen at the immediately following meeting). And then hopefully I or other committee members will pursue other things (concurrent forEach, out-of-order concurrency, merge, etc) as followups.

cc @conartist6 @laverdet as people who have been particularly involved in discussions lately.

bakkot avatar Jun 03 '24 18:06 bakkot