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

onBackpressureBuffer(int) errors on overflow #3233

Closed
abersnaze opened this issue Aug 28, 2015 · 2 comments
Closed

onBackpressureBuffer(int) errors on overflow #3233

abersnaze opened this issue Aug 28, 2015 · 2 comments

Comments

@abersnaze
Copy link
Contributor

Talking with @neerajrj this morning about various Rx issues. One of them is that onBackpressureBuffer(int) defaults to sending an error if the limited buffer is full. He would like to have the option to do different things on overflow.

I'm suggesting adding an enum OnOverflow { DROP_OLDEST, DROP_LATEST, ERROR } to the arguments to allow the user to decide what the overflow behavior should be.

Could onBackpressureDrop() be rewritten to onBackpressureBuffer(0, OnOverflow.DROP_OLDEST) and onBackpressureLatest() would be onBackpressureBuffer(1, OnOverflow.DROP_OLDEST)?

@neerajrj
Copy link
Contributor

+1 Also have an Action0 option to be informed when dropping is occuring.

@srvaroa
Copy link
Contributor

srvaroa commented Nov 2, 2015

I've got this almost ready, I need some polishing but will be pushing a PR today/tomorrow the latest.

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

4 participants