Class CompletableCreate.Emitter
java.lang.Object
java.util.concurrent.atomic.AtomicReference<Disposable>
io.reactivex.rxjava3.internal.operators.completable.CompletableCreate.Emitter
- All Implemented Interfaces:
CompletableEmitter,Disposable,Serializable
- Enclosing class:
CompletableCreate
static final class CompletableCreate.Emitter
extends AtomicReference<Disposable>
implements CompletableEmitter, Disposable
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final CompletableObserverprivate static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Dispose the resource, the operation should be idempotent.booleanReturns true if the downstream disposed the sequence or the emitter was terminated viaCompletableEmitter.onError(Throwable),CompletableEmitter.onComplete()or a successfulCompletableEmitter.tryOnError(Throwable).voidSignal the completion.voidSignal an exception.voidSets a Cancellable on this emitter; any previousDisposableorCancellablewill be disposed/cancelled.voidSets a Disposable on this emitter; any previousDisposableorCancellablewill be disposed/cancelled.toString()booleanAttempts to emit the specifiedThrowableerror if the downstream hasn't cancelled the sequence or is otherwise terminated, returning false if the emission is not allowed to happen due to lifecycle restrictions.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, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
downstream
-
-
Constructor Details
-
Emitter
Emitter(CompletableObserver downstream)
-
-
Method Details
-
onComplete
public void onComplete()Description copied from interface:CompletableEmitterSignal the completion.- Specified by:
onCompletein interfaceCompletableEmitter
-
onError
Description copied from interface:CompletableEmitterSignal an exception.- Specified by:
onErrorin interfaceCompletableEmitter- Parameters:
t- the exception, not null
-
tryOnError
Description copied from interface:CompletableEmitterAttempts to emit the specifiedThrowableerror if the downstream hasn't cancelled the sequence or is otherwise terminated, returning false if the emission is not allowed to happen due to lifecycle restrictions.Unlike
CompletableEmitter.onError(Throwable), theRxjavaPlugins.onErroris not called if the error could not be delivered.History: 2.1.1 - experimental
- Specified by:
tryOnErrorin interfaceCompletableEmitter- Parameters:
t- the throwable error to signal if possible- Returns:
- true if successful, false if the downstream is not able to accept further events
-
setDisposable
Description copied from interface:CompletableEmitterSets a Disposable on this emitter; any previousDisposableorCancellablewill be disposed/cancelled.- Specified by:
setDisposablein interfaceCompletableEmitter- Parameters:
d- the disposable, null is allowed
-
setCancellable
Description copied from interface:CompletableEmitterSets a Cancellable on this emitter; any previousDisposableorCancellablewill be disposed/cancelled.- Specified by:
setCancellablein interfaceCompletableEmitter- Parameters:
c- the cancellable resource, null is allowed
-
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:CompletableEmitterReturns true if the downstream disposed the sequence or the emitter was terminated viaCompletableEmitter.onError(Throwable),CompletableEmitter.onComplete()or a successfulCompletableEmitter.tryOnError(Throwable).This method is thread-safe.
- Specified by:
isDisposedin interfaceCompletableEmitter- Specified by:
isDisposedin interfaceDisposable- Returns:
- true if the downstream disposed the sequence or the emitter was terminated
-
toString
- Overrides:
toStringin classAtomicReference<Disposable>
-