Skip to content

3.x: Flowable.publish() should not drop items if there are no consumers #5899

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

Closed
akarnokd opened this issue Mar 7, 2018 · 3 comments
Closed
Milestone

Comments

@akarnokd
Copy link
Member

akarnokd commented Mar 7, 2018

Unlike Observable.publish(), the Flowable.publish() has an internal queue and fetches data from upstream based on consumption. For historical reasons, the 2.x implementation drops items when there are no consumers, which can lead to unnecessary dataloss when switching between consumers on an item boundary.

I propose changing the operator in 3.x to not drop items when there are no consumers. The 2.x behavior can be achieved via an additional unbounded consumer which stays subscribed until the operator completes.

@davidmoten
Copy link
Collaborator

I propose changing the operator in 3.x to not drop items when there are no consumers.

Does this only apply after the first subscription has happened?

@akarnokd
Copy link
Member Author

If there are no subscribers, don't consume the queue. The 2.x version has dedicated logic to keep consuming the queue.

@akarnokd
Copy link
Member Author

Closing via #6519.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants