-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Incorrect pMapIterable
behaviour
#76
Comments
tgfisher4
added a commit
to tgfisher4/p-map
that referenced
this issue
Aug 25, 2024
…ddress case of: infinite concurrency + async iterable producing >1 element 2. use `!isSyncIterator` as shortcut for `isPromiseLike(next)` (`next` is promise iff iterator is async) 3. add `trySpawn` to the `returnValue === pMapSkip && preserveOrder && (promise mapping next input iterable element is pending` branch 4. add tests for changes (1) and (3) 5. tests `rangeAround` helper 6. extra `pMapSkip` tests 7. test for sindresorhus#76
tgfisher4
added a commit
to tgfisher4/p-map
that referenced
this issue
Aug 25, 2024
… case of: infinite concurrency + async iterable producing >1 element 2. use `!isSyncIterator` as shortcut for `isPromiseLike(next)` (`next` is promise iff iterator is async) 3. add `trySpawn` to the `returnValue === pMapSkip && preserveOrder && (promise mapping next input iterable element is pending` branch 4. add tests for changes (1) and (3) 5. tests `rangeAround` helper 6. extra `pMapSkip` tests 7. test for sindresorhus#76
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pMapIterable
doesn't adhere to the concurrency limit when the source is an async iterable andbackpressure
>concurrency
.Here's an example program that reproduces the issue:
Current output:
Expected output:
As you can see, the mapper function has two instances running in parallel even though concurrency is set to 1.
FYI @Richienb
The text was updated successfully, but these errors were encountered: