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

Special case for parEvalMap with max concurrency of 1 #2577

Merged
merged 1 commit into from
Sep 1, 2021

Conversation

bastewart
Copy link
Contributor

This avoids the penalty of using the combinator if there is no
concurrency. Analogous to #2557 which did the same for parJoin.

This avoids the penalty of using the combinator if there is no
concurrency. Analogous to typelevel#2557 which did the same for `parJoin`.
send = chan.send(value.get).as {
Stream.eval(f(o).attempt.flatMap(value.complete(_).void))
)(f: O => F2[O2])(implicit F: Concurrent[F2]): Stream[F2, O2] =
if (maxConcurrent === 1) evalMap(f)
Copy link
Contributor Author

@bastewart bastewart Aug 27, 2021

Choose a reason for hiding this comment

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

There is no direct assertion that maxConcurrent is > 0 in parEvalMap. There is an indirect on though as ultimately parEvalMap calls parJoin which does do this assertion.

@bastewart
Copy link
Contributor Author

@Daenyth sorry, not sure what to do here! Do I wait for another maintainer to give a second opinion and they'll potentially merge it?

@mpilquist mpilquist merged commit 1cb27af into typelevel:main Sep 1, 2021
@mpilquist
Copy link
Member

@bastewart Thanks!

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.

3 participants