public final class CompletableConsumers extends Object
Completable
s.Modifier and Type | Method and Description |
---|---|
static Disposable |
subscribeAutoDispose(Completable source,
CompositeDisposable composite,
Action onComplete)
Wraps the given onXXX callbacks into a
Disposable CompletableObserver ,
adds it to the given CompositeDisposable and ensures, that if the upstream
completes or this particlular Disposable is disposed, the CompletableObserver is removed
from the given composite. |
static Disposable |
subscribeAutoDispose(Completable source,
CompositeDisposable composite,
Action onComplete,
Consumer<? super Throwable> onError)
Wraps the given onXXX callbacks into a
Disposable CompletableObserver ,
adds it to the given CompositeDisposable and ensures, that if the upstream
completes or this particlular Disposable is disposed, the CompletableObserver is removed
from the given composite. |
public static Disposable subscribeAutoDispose(Completable source, CompositeDisposable composite, Action onComplete)
Disposable
CompletableObserver
,
adds it to the given CompositeDisposable
and 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.
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 completespublic static Disposable subscribeAutoDispose(Completable source, CompositeDisposable composite, Action onComplete, Consumer<? super Throwable> onError)
Disposable
CompletableObserver
,
adds it to the given CompositeDisposable
and 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.
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