Skip to content

Have materialize() and dematerialize() for Maybe, Single and Completable? #6272

@akarnokd

Description

@akarnokd

Observable and Flowable already have these methods, it might be worth adding them to Maybe, Single and Completable.

The main benefit I see with Maybe and Single is for the zip operator which now could wait for all source outcomes and the zipper will be always invoked.

Note that Completable.materialize() would become Single<Notification<T>> as well. T could be Void or an arbitrary target type:

Single<Notification<Void>> c = Completable.complete().<Void>materialize();
Single<Notification<Integer>> s = Single.just(1).materialize();
Single<Notification<Integer>> m = Maybe.<Integer>empty().materialize();

Single.zip(c, s, m, (a, b, c) -> 1);

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