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

Fix zipWith to work concurrently according to the stream type #158

Open
harendra-kumar opened this issue Dec 7, 2018 · 5 comments
Open
Assignees
Labels
aspect:streams Unfolds and streams type:enhancement User visible feature

Comments

@harendra-kumar
Copy link
Member

zipWith and zipWithM currently work serially. They should instead work according to the stream type. For example, if the stream type is Async then they can zip multiple pairs concurrently out of order. For testing, one use case of this is mentioned in #100 .

The fix is simple, we need to use consM to build the stream, just like we do in concurrent mapM. We will just have to test it, that it works as expected.

cc @naushadh

@harendra-kumar harendra-kumar added the type:enhancement User visible feature label Dec 7, 2018
@naushadh
Copy link

naushadh commented Dec 9, 2018

I suppose this is complementary to the existing zipAsyncWith?

@harendra-kumar
Copy link
Member Author

zipAsyncWith makes sure that the actions from both the streams being zipped are executed concurrently, once it has the two items to zip, then it uses zipWith to zip the two items. So only one zip happens at a time. In case of ahead/async streams we can have multiple zips going on at the same time.

@harendra-kumar
Copy link
Member Author

@adithyaov if this is fixed then you can close it.

@harendra-kumar
Copy link
Member Author

Reopened by #1125, the commit was reverted by e094283.

@adithyaov
Copy link
Member

We can possibly have zipConcurrentlyWithM for concurrent zipping.
We should leave zipWith(M) alone as they break existing code.

@adithyaov adithyaov modified the milestones: 0.8.2, 0.9.0 Feb 2, 2022
@harendra-kumar harendra-kumar modified the milestones: 0.9.0, 0.10.0 Sep 7, 2022
@harendra-kumar harendra-kumar modified the milestones: 0.10.0, 0.11.0 Jul 13, 2023
@harendra-kumar harendra-kumar removed this from the 0.11.0 milestone Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aspect:streams Unfolds and streams type:enhancement User visible feature
Projects
None yet
Development

No branches or pull requests

3 participants