MaybeObserver onComplete not called, only onSuccess called
dragossusi opened this issue · 1 comments
RxFirebaseDatabase.observeSingleValueEvent() doesn't call onComplete
Is the way it should work, Maybe calls just call one of the consumers. You can check the Maybe contract in the official documentation : http://reactivex.io/RxJava/javadoc/io/reactivex/MaybeObserver.html
You can read it too in the differences in Rx Java 2.0 : https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#maybe
The Maybe class is accompanied by MaybeSource as its base interface type, MaybeObserver as its signal-receiving interface and follows the protocol onSubscribe (onSuccess | onError | onComplete)?. Because there could be at most 1 element emitted, the Maybe type has no notion of backpressure (because there is no buffer bloat possible as with unknown length Flowables or Observables.
This means that an invocation of onSubscribe(Disposable) is potentially followed by one of the other onXXX methods. Unlike Flowable, if there is only a single value to be signalled, only onSuccess is called and onComplete is not.