Skip to content

Hot Observable Handling - MissingBackpressureException #12

@benjchristensen

Description

@benjchristensen

RxJava allows "hot" Observables in a different manner than Reactive Streams so we need to account for this.

In Reactive Streams a Publisher can never emit more than has been requested. An Observable however can choose to just be hot and emit.

See https://speakerdeck.com/benjchristensen/reactive-programming-with-rx-at-qconsf-2014?slide=114 and https://speakerdeck.com/benjchristensen/reactive-programming-with-rx-at-qconsf-2014?slide=21

screen shot 2014-11-08 at 8 10 18 am

This means that when converting from Observable to Reactive Stream Publisher we may have an Observable that does not obey request(n) either because it can't (it's hot) or the Observable just doesn't support it (thus it acts hot even if it is a cold source).

I think this means we need to put in some logic in the bridge that throws MissingBackpressureException if we receive more onNext than are requested so it complies with the RxJava contract and doesn't emit more to the downstream Reactive Stream implementation out of contract.

This would then force a choice of strategy for dealing with this: https://github.com/ReactiveX/RxJava/wiki/Backpressure and https://speakerdeck.com/benjchristensen/reactive-programming-with-rx-at-qconsf-2014?slide=89

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions