Skip to content

Add par_map methods to collections - #227

Open
brendanmaguire wants to merge 1 commit into
dbrattli:mainfrom
brendanmaguire:added-par-map
Open

Add par_map methods to collections#227
brendanmaguire wants to merge 1 commit into
dbrattli:mainfrom
brendanmaguire:added-par-map

Conversation

@brendanmaguire

Copy link
Copy Markdown
Contributor
  • par_map facilitates running an async function across all items in the collection
  • Resolves Async methods #213

@brendanmaguire

Copy link
Copy Markdown
Contributor Author

@dbrattli , do you think this is an okay approach to this?

* `par_map` facilitates running an async function across all items in the collection
* Resolves dbrattli#213
@timok19

timok19 commented Mar 5, 2025

Copy link
Copy Markdown

HI! Is there any updates on that? :)

@dbrattli dbrattli left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the async collection proposal. Before this can be reviewed, please rebase it onto current main (the branch is 27 commits behind) and address these blockers:

  1. Map.par_map consumes self.to_seq() while constructing the coroutines, then consumes it again for keys. The Map iterator is single-use, so the second pass is empty and a successful call returns an empty map. Materialize the item pairs once (or carry each key through the gathered work) and add a regression assertion that the result contains all original keys.
  2. The tests assert a < 0.2 wall-clock duration for 0.1-second sleeps. That is scheduler/load dependent and will be flaky in CI. Test concurrent start/completion deterministically (for example, with synchronization primitives) instead of elapsed time.

Please retain ordering and error-propagation coverage across all collection variants when rebasing.

This was referenced Aug 15, 2026
@brendanmaguire

Copy link
Copy Markdown
Contributor Author

I won't have time to work on this. If someone else wants to pick it up, feel free. Or close if you'd like.

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

Successfully merging this pull request may close these issues.

Async methods

3 participants