8000 Reimplement parallel map functions without state by johnhungerford · Pull Request #1241 · getkyo/kyo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Reimplement parallel map functions without state #1241

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

johnhungerford
Copy link
Contributor
@johnhungerford johnhungerford commented Jun 6, 2025 8000

Fixes #1192

Problem

mapChunkPar tests were flaky due to the use of SignalRef

Solution

Use a channel of size parallel instead to limit concurrency.

Also reimplemented mapPar, mapParUnordered, and mapChunkParUnordered similarly without state (they were using AtomicRef). I think they are a bit easier to understand this way, and are more consistent with each other now.

Notes

@johnhungerford
Copy link
Contributor Author

@ahoy-jon I added some comments as promised on discord. I also made a further simplification eliminating the need to use a stateful stream handler.

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.

[BUG]: Missed signals in Stream.mapChunkPar
1 participant
0