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

Operator groupBy produces Streams with incorrect behavior #575

Open
NaikSoftware opened this issue Apr 14, 2021 · 6 comments
Open

Operator groupBy produces Streams with incorrect behavior #575

NaikSoftware opened this issue Apr 14, 2021 · 6 comments
Labels
waiting for response Waiting for follow up

Comments

@NaikSoftware
Copy link

NaikSoftware commented Apr 14, 2021

Code below works fine

.groupBy((event) => event.type)
.flatMap((groupByType) => groupByType.toSet().asStream())

But if you change to this - onNext never called because of groupByType.toSet() never completes

.groupBy((event) => event.type)
.asyncMap((groupByType) => groupByType.toSet())

rxdart: ^0.26.0

@hoc081098
Copy link
Collaborator

That is expected behavior

@hoc081098
Copy link
Collaborator

You can use scan((acc, e) => {...acc!, e}, <Object>{}) instead toSet()

@NaikSoftware
Copy link
Author

@hoc081098 can you explain why this is expected behaviour?

@hoc081098
Copy link
Collaborator

@hoc081098 can you explain why this is expected behaviour?

Each group will complete when upstream (source stream) completes.

@NaikSoftware
Copy link
Author

@hoc081098 Where I said what upstream never completes?) It just a stream from list.

@hoc081098
Copy link
Collaborator

hoc081098 commented Sep 3, 2021

@hoc081098 Where I said what upstream never completes?) It just a stream from list.

Could you provide some code to reproduce this issue? Thanks

@hoc081098 hoc081098 added the waiting for response Waiting for follow up label May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for response Waiting for follow up
Projects
None yet
Development

No branches or pull requests

2 participants