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

parallelFirst with cancel #16

Open
nstepp opened this issue Sep 12, 2023 · 0 comments
Open

parallelFirst with cancel #16

nstepp opened this issue Sep 12, 2023 · 0 comments

Comments

@nstepp
Copy link

nstepp commented Sep 12, 2023

At first I thought that parallelFirst was exactly what I needed for my problem, but unless I'm not using it right (which is very possible), it's just a bit different than I was expecting.

It returns the first result, but all actions are computed, instead of canceling the remaining computations after the first result. Is it supposed to cancel them, and I'm seeing an odd behavior?

Would it match the intended semantics of parallelFirst if it were changed to this behavior, or would a parallelFirstCancel be useful? There is an analogous function in async: waitAnyCancel, but it doesn't provide the pool mechanics or use Maybe.

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

No branches or pull requests

1 participant