@@ -388,6 +388,8 @@ public static Completable error(final Throwable error) {
388
388
/**
389
389
* Returns a Completable instance that runs the given Action for each subscriber and
390
390
* emits either an unchecked exception or simply completes.
391
+ * <p>
392
+ * <img width="640" height="297" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.fromAction.png" alt="">
391
393
* <dl>
392
394
* <dt><b>Scheduler:</b></dt>
393
395
* <dd>{@code fromAction} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -406,6 +408,8 @@ public static Completable fromAction(final Action run) {
406
408
/**
407
409
* Returns a Completable which when subscribed, executes the callable function, ignores its
408
410
* normal result and emits onError or onComplete only.
411
+ * <p>
412
+ * <img width="640" height="286" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.fromCallable.png" alt="">
409
413
* <dl>
410
414
* <dt><b>Scheduler:</b></dt>
411
415
* <dd>{@code fromCallable} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -423,6 +427,8 @@ public static Completable fromCallable(final Callable<?> callable) {
423
427
/**
424
428
* Returns a Completable instance that reacts to the termination of the given Future in a blocking fashion.
425
429
* <p>
430
+ * <img width="640" height="628" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.fromFuture.png" alt="">
431
+ * <p>
426
432
* Note that cancellation from any of the subscribers to this Completable will cancel the future.
427
433
* <dl>
428
434
* <dt><b>Scheduler:</b></dt>
@@ -438,9 +444,33 @@ public static Completable fromFuture(final Future<?> future) {
438
444
return fromAction (Functions .futureAction (future ));
439
445
}
440
446
447
+ /**
448
+ * Returns a Completable instance that when subscribed to, subscribes to the {@code Maybe} instance and
449
+ * emits a completion event if the maybe emits {@code onSuccess}/{@code onComplete} or forwards any
450
+ * {@code onError} events.
451
+ * <p>
452
+ * <img width="640" height="235" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.fromMaybe.png" alt="">
453
+ * <dl>
454
+ * <dt><b>Scheduler:</b></dt>
455
+ * <dd>{@code fromMaybe} does not operate by default on a particular {@link Scheduler}.</dd>
456
+ * </dl>
457
+ * @param <T> the value type of the {@link MaybeSource} element
458
+ * @param maybe the Maybe instance to subscribe to, not null
459
+ * @return the new Completable instance
460
+ * @throws NullPointerException if single is null
461
+ */
462
+ @ CheckReturnValue
463
+ @ SchedulerSupport (SchedulerSupport .NONE )
464
+ public static <T > Completable fromMaybe (final MaybeSource <T > maybe ) {
465
+ ObjectHelper .requireNonNull (maybe , "maybe is null" );
466
+ return RxJavaPlugins .onAssembly (new MaybeIgnoreElementCompletable <T >(maybe ));
467
+ }
468
+
441
469
/**
442
470
* Returns a Completable instance that runs the given Runnable for each subscriber and
443
471
* emits either its exception or simply completes.
472
+ * <p>
473
+ * <img width="640" height="297" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.fromRunnable.png" alt="">
444
474
* <dl>
445
475
* <dt><b>Scheduler:</b></dt>
446
476
* <dd>{@code fromRunnable} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -459,6 +489,8 @@ public static Completable fromRunnable(final Runnable run) {
459
489
/**
460
490
* Returns a Completable instance that subscribes to the given Observable, ignores all values and
461
491
* emits only the terminal event.
492
+ * <p>
493
+ * <img width="640" height="414" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.fromObservable.png" alt="">
462
494
* <dl>
463
495
* <dt><b>Scheduler:</b></dt>
464
496
* <dd>{@code fromObservable} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -479,6 +511,8 @@ public static <T> Completable fromObservable(final ObservableSource<T> observabl
479
511
* Returns a Completable instance that subscribes to the given publisher, ignores all values and
480
512
* emits only the terminal event.
481
513
* <p>
514
+ * <img width="640" height="442" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.fromPublisher.png" alt="">
515
+ * <p>
482
516
* The {@link Publisher} must follow the
483
517
* <a href="https://github.com/reactive-streams/reactive-streams-jvm#reactive-streams">Reactive-Streams specification</a>.
484
518
* Violating the specification may result in undefined behavior.
@@ -513,6 +547,8 @@ public static <T> Completable fromPublisher(final Publisher<T> publisher) {
513
547
/**
514
548
* Returns a Completable instance that when subscribed to, subscribes to the Single instance and
515
549
* emits a completion event if the single emits onSuccess or forwards any onError events.
550
+ * <p>
551
+ * <img width="640" height="356" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.fromSingle.png" alt="">
516
552
* <dl>
517
553
* <dt><b>Scheduler:</b></dt>
518
554
* <dd>{@code fromSingle} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -532,6 +568,8 @@ public static <T> Completable fromSingle(final SingleSource<T> single) {
532
568
/**
533
569
* Returns a Completable instance that subscribes to all sources at once and
534
570
* completes only when all source Completables complete or one of them emits an error.
571
+ * <p>
572
+ * <img width="640" height="270" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.mergeArray.png" alt="">
535
573
* <dl>
536
574
* <dt><b>Scheduler:</b></dt>
537
575
* <dd>{@code mergeArray} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -569,6 +607,8 @@ public static Completable mergeArray(CompletableSource... sources) {
569
607
/**
570
608
* Returns a Completable instance that subscribes to all sources at once and
571
609
* completes only when all source Completables complete or one of them emits an error.
610
+ * <p>
611
+ * <img width="640" height="311" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.merge.png" alt="">
572
612
* <dl>
573
613
* <dt><b>Scheduler:</b></dt>
574
614
* <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -601,6 +641,8 @@ public static Completable merge(Iterable<? extends CompletableSource> sources) {
601
641
/**
602
642
* Returns a Completable instance that subscribes to all sources at once and
603
643
* completes only when all source Completables complete or one of them emits an error.
644
+ * <p>
645
+ * <img width="640" height="336" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.merge.p.png" alt="">
604
646
* <dl>
605
647
* <dt><b>Backpressure:</b></dt>
606
648
* <dd>The returned {@code Completable} honors the backpressure of the downstream consumer
@@ -635,6 +677,8 @@ public static Completable merge(Publisher<? extends CompletableSource> sources)
635
677
/**
636
678
* Returns a Completable instance that keeps subscriptions to a limited number of sources at once and
637
679
* completes only when all source Completables complete or one of them emits an error.
680
+ * <p>
681
+ * <img width="640" height="269" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.merge.pn.png" alt="">
638
682
* <dl>
639
683
* <dt><b>Backpressure:</b></dt>
640
684
* <dd>The returned {@code Completable} honors the backpressure of the downstream consumer
@@ -699,6 +743,8 @@ private static Completable merge0(Publisher<? extends CompletableSource> sources
699
743
* Returns a CompletableConsumable that subscribes to all Completables in the source array and delays
700
744
* any error emitted by either the sources observable or any of the inner Completables until all of
701
745
* them terminate in a way or another.
746
+ * <p>
747
+ * <img width="640" height="430" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.mergeArrayDelayError.png" alt="">
702
748
* <dl>
703
749
* <dt><b>Scheduler:</b></dt>
704
750
* <dd>{@code mergeArrayDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -718,6 +764,8 @@ public static Completable mergeArrayDelayError(CompletableSource... sources) {
718
764
* Returns a Completable that subscribes to all Completables in the source sequence and delays
719
765
* any error emitted by either the sources observable or any of the inner Completables until all of
720
766
* them terminate in a way or another.
767
+ * <p>
768
+ * <img width="640" height="475" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.mergeDelayError.png" alt="">
721
769
* <dl>
722
770
* <dt><b>Scheduler:</b></dt>
723
771
* <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -738,6 +786,8 @@ public static Completable mergeDelayError(Iterable<? extends CompletableSource>
738
786
* Returns a Completable that subscribes to all Completables in the source sequence and delays
739
787
* any error emitted by either the sources observable or any of the inner Completables until all of
740
788
* them terminate in a way or another.
789
+ * <p>
790
+ * <img width="640" height="466" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.mergeDelayError.p.png" alt="">
741
791
* <dl>
742
792
* <dt><b>Backpressure:</b></dt>
743
793
* <dd>The returned {@code Completable} honors the backpressure of the downstream consumer
@@ -761,6 +811,8 @@ public static Completable mergeDelayError(Publisher<? extends CompletableSource>
761
811
* the source sequence and delays any error emitted by either the sources
762
812
* observable or any of the inner Completables until all of
763
813
* them terminate in a way or another.
814
+ * <p>
815
+ * <img width="640" height="440" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.mergeDelayError.pn.png" alt="">
764
816
* <dl>
765
817
* <dt><b>Backpressure:</b></dt>
766
818
* <dd>The returned {@code Completable} honors the backpressure of the downstream consumer
@@ -782,6 +834,8 @@ public static Completable mergeDelayError(Publisher<? extends CompletableSource>
782
834
783
835
/**
784
836
* Returns a Completable that never calls onError or onComplete.
837
+ * <p>
838
+ * <img width="640" height="512" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.never.png" alt="">
785
839
* <dl>
786
840
* <dt><b>Scheduler:</b></dt>
787
841
* <dd>{@code never} does not operate by default on a particular {@link Scheduler}.</dd>
@@ -796,6 +850,8 @@ public static Completable never() {
796
850
797
851
/**
798
852
* Returns a Completable instance that fires its onComplete event after the given delay elapsed.
853
+ * <p>
854
+ * <img width="640" height="413" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.timer.png" alt="">
799
855
* <dl>
800
856
* <dt><b>Scheduler:</b></dt>
801
857
* <dd>{@code timer} does operate by default on the {@code computation} {@link Scheduler}.</dd>
@@ -813,6 +869,8 @@ public static Completable timer(long delay, TimeUnit unit) {
813
869
/**
814
870
* Returns a Completable instance that fires its onComplete event after the given delay elapsed
815
871
* by using the supplied scheduler.
872
+ * <p>
873
+ * <img width="640" height="413" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.timer.s.png" alt="">
816
874
* <dl>
817
875
* <dt><b>Scheduler:</b></dt>
818
876
* <dd>{@code timer} operates on the {@link Scheduler} you specify.</dd>
0 commit comments