Skip to content

onBackpressureBuffer(int) errors on overflow #3233

Closed

Description

@abersnaze

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)?

Activity

  1. neerajrj commented on Aug 28, 2015

    @neerajrj
    Contributor

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

  2. srvaroa commented on Nov 2, 2015

    @srvaroa
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions