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

Backpressure strategy #11

Closed
DavidJFelix opened this issue Apr 19, 2017 · 1 comment
Closed

Backpressure strategy #11

DavidJFelix opened this issue Apr 19, 2017 · 1 comment

Comments

@DavidJFelix
Copy link

I've been wondering about the backpressure strategy you have set for the flowable on database. Right now it's set to buffer, which will maintain a buffer of ALL events. I'm not sure that this is the right approach. If the purpose is to wrap firebase with rx, there's rarely a good reason to present inaccurate snapshots to any consumer. I think you should be using the LATEST backpressure strategy. In LATEST, if n writes occur before n-1 writes are read by the subscriber, the latest value will be overwritten on the unread write. This seems to be exactly what firebase does in an non-rx flow.

What do you think?

@ashdavies
Copy link
Owner

I had been thinking more on the use case of addChildEventListener where snapshots wouldn't necessarily be inaccurate and the responsibility comes to the consumer to decide on the relevancy.

I understand your point, but I prefer this approach as it doesn't risk any data not being "lost", perhaps it could be made clearer to the user that they must handle potentially outdated snapshots, or allow them to specify their own backpressure strategy.

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

2 participants