Class CallbackCompletableObserver
- java.lang.Object
-
- java.util.concurrent.atomic.AtomicReference<Disposable>
-
- io.reactivex.rxjava3.internal.observers.CallbackCompletableObserver
-
- All Implemented Interfaces:
CompletableObserver,Disposable,LambdaConsumerIntrospection,java.io.Serializable
public final class CallbackCompletableObserver extends java.util.concurrent.atomic.AtomicReference<Disposable> implements CompletableObserver, Disposable, LambdaConsumerIntrospection
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ActiononComplete(package private) Consumer<? super java.lang.Throwable>onErrorprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description CallbackCompletableObserver(Consumer<? super java.lang.Throwable> onError, Action onComplete)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Dispose the resource, the operation should be idempotent.booleanhasCustomOnError()Returnstrueorfalseif a customonErrorconsumer has been provided.booleanisDisposed()Returns true if this resource has been disposed.voidonComplete()Called once the deferred computation completes normally.voidonError(java.lang.Throwable e)Called once if the deferred computation 'throws' an exception.voidonSubscribe(Disposable d)Called once by theCompletableto set aDisposableon this instance which then can be used to cancel the subscription at any time.-
Methods inherited from class java.util.concurrent.atomic.AtomicReference
accumulateAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, get, getAcquire, getAndAccumulate, getAndSet, getAndUpdate, getOpaque, getPlain, lazySet, set, setOpaque, setPlain, setRelease, toString, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
onError
final Consumer<? super java.lang.Throwable> onError
-
onComplete
final Action onComplete
-
-
Method Detail
-
onComplete
public void onComplete()
Description copied from interface:CompletableObserverCalled once the deferred computation completes normally.- Specified by:
onCompletein interfaceCompletableObserver
-
onError
public void onError(java.lang.Throwable e)
Description copied from interface:CompletableObserverCalled once if the deferred computation 'throws' an exception.- Specified by:
onErrorin interfaceCompletableObserver- Parameters:
e- the exception, notnull.
-
onSubscribe
public void onSubscribe(Disposable d)
Description copied from interface:CompletableObserverCalled once by theCompletableto set aDisposableon this instance which then can be used to cancel the subscription at any time.- Specified by:
onSubscribein interfaceCompletableObserver- Parameters:
d- theDisposableinstance to call dispose on for cancellation, not null
-
dispose
public void dispose()
Description copied from interface:DisposableDispose the resource, the operation should be idempotent.- Specified by:
disposein interfaceDisposable
-
isDisposed
public boolean isDisposed()
Description copied from interface:DisposableReturns true if this resource has been disposed.- Specified by:
isDisposedin interfaceDisposable- Returns:
- true if this resource has been disposed
-
hasCustomOnError
public boolean hasCustomOnError()
Description copied from interface:LambdaConsumerIntrospectionReturnstrueorfalseif a customonErrorconsumer has been provided.- Specified by:
hasCustomOnErrorin interfaceLambdaConsumerIntrospection- Returns:
trueif a customonErrorconsumer implementation was supplied. Returnsfalseif the implementation is missing an error consumer and thus using a throwing default implementation.
-
-