Package hu.akarnokd.rxjava3.consumers
Class CompletableConsumers
- java.lang.Object
-
- hu.akarnokd.rxjava3.consumers.CompletableConsumers
-
public final class CompletableConsumers extends java.lang.ObjectUtility methods for creating and using consumersCompletables.- Since:
- 0.18.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DisposablesubscribeAutoDispose(Completable source, CompositeDisposable composite, Action onComplete)Wraps the given onXXX callbacks into aDisposableCompletableObserver, adds it to the givenCompositeDisposableand ensures, that if the upstream completes or this particlular Disposable is disposed, the CompletableObserver is removed from the given composite.static DisposablesubscribeAutoDispose(Completable source, CompositeDisposable composite, Action onComplete, Consumer<? super java.lang.Throwable> onError)Wraps the given onXXX callbacks into aDisposableCompletableObserver, adds it to the givenCompositeDisposableand ensures, that if the upstream completes or this particlular Disposable is disposed, the CompletableObserver is removed from the given composite.
-
-
-
Method Detail
-
subscribeAutoDispose
public static Disposable subscribeAutoDispose(Completable source, CompositeDisposable composite, Action onComplete)
Wraps the given onXXX callbacks into aDisposableCompletableObserver, adds it to the givenCompositeDisposableand ensures, that if the upstream completes or this particlular Disposable is disposed, the CompletableObserver is removed from the given composite.The CompletableObserver will be removed after the callback for the terminal event has been invoked.
- Parameters:
source- the source Completable to subscribe to.composite- the composite Disposable to add and remove the created Disposable CompletableObserveronComplete- the callback for when the upstream completes- Returns:
- the Disposable that allows disposing the particular subscription.
-
subscribeAutoDispose
public static Disposable subscribeAutoDispose(Completable source, CompositeDisposable composite, Action onComplete, Consumer<? super java.lang.Throwable> onError)
Wraps the given onXXX callbacks into aDisposableCompletableObserver, adds it to the givenCompositeDisposableand ensures, that if the upstream completes or this particlular Disposable is disposed, the CompletableObserver is removed from the given composite.The CompletableObserver will be removed after the callback for the terminal event has been invoked.
- Parameters:
source- the source Completable to subscribe to.composite- the composite Disposable to add and remove the created Disposable CompletableObserveronComplete- the callback for when the upstream completesonError- the callback for an upstream error if any- Returns:
- the Disposable that allows disposing the particular subscription.
-
-