Rxjava: Maybe.just is not calling onComplete

Created on 12 Sep 2016  路  8Comments  路  Source: ReactiveX/RxJava

If you create a MaybeObservable with Maybe.just("foo"), it is never triggering an onComplete call on the MaybeObserver. Unless i'm missing something, shouldn't Maybe follow the same pattern as Observable? Either:

observer.onSuccess
observer.onComplete

OR

observer.onError

Question

Most helpful comment

Flowable: onSubscribe oNext* (onError | onComplete)?
Observable: onSubscribe oNext* (onError | onComplete)?
Single: onSubscribe (onSuccess | onError)?
Completable: onSubscribe (onError | onComplete)?
Maybe: onSubscribe (onSuccess | onError | onComplete)?

Maybe is a hybrid of Single and Completable where only one of the |-ed method is called.

All 8 comments

AFAIK this is intended. It's either onError | onComplete | onSuccess

So, it's either a value was loaded, a value was not loaded, or there was an error. corresponding to onSuccess, onComplete and onError, respectively?

Is there documentation for 2.0? That's something i was not able to really find.

Flowable: onSubscribe oNext* (onError | onComplete)?
Observable: onSubscribe oNext* (onError | onComplete)?
Single: onSubscribe (onSuccess | onError)?
Completable: onSubscribe (onError | onComplete)?
Maybe: onSubscribe (onSuccess | onError | onComplete)?

Maybe is a hybrid of Single and Completable where only one of the |-ed method is called.

Thanks. On an unrelated note, any reason why there's no switchIfEmpty on Maybe?

I suppose you can also close this issue.

I had to release RC2 because of a few annoying bugs and Maybe got in partially implemented. RC3 will have all reasonable operators added but you can use the 2.x snapshot right now which does already have switchIfEmpty.

By the way. Maybe.switchIfEmpty(Single) is semantically a single if you haven't created that function yet. Bit would've a nice addition

Was this page helpful?
0 / 5 - 0 ratings