Class ObservableCreate.CreateEmitter<T>
java.lang.Object
java.util.concurrent.atomic.AtomicReference<Disposable>
io.reactivex.rxjava3.internal.operators.observable.ObservableCreate.CreateEmitter<T>
- All Implemented Interfaces:
Emitter<T>,ObservableEmitter<T>,Disposable,Serializable
- Enclosing class:
ObservableCreate<T>
static final class ObservableCreate.CreateEmitter<T>
extends AtomicReference<Disposable>
implements ObservableEmitter<T>, Disposable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate 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 viaEmitter.onError(Throwable),Emitter.onComplete()or a successfulObservableEmitter.tryOnError(Throwable).voidSignal a completion.voidSignal aThrowableexception.voidSignal a normal value.Ensures that calls toonNext,onErrorandonCompleteare properly serialized.voidSets aCancellableon this emitter; any previousDisposableorCancellablewill be disposed/cancelled.voidSets aDisposableon 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:
-
observer
-
-
Constructor Details
-
CreateEmitter
-
-
Method Details
-
onNext
Description copied from interface:EmitterSignal a normal value. -
onError
Description copied from interface:EmitterSignal aThrowableexception. -
tryOnError
Description copied from interface:ObservableEmitterAttempts 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
Emitter.onError(Throwable), theRxjavaPlugins.onErroris not called if the error could not be delivered.History: 2.1.1 - experimental
- Specified by:
tryOnErrorin interfaceObservableEmitter<T>- Parameters:
t- theThrowableerror to signal if possible- Returns:
- true if successful, false if the downstream is not able to accept further events
-
onComplete
public void onComplete()Description copied from interface:EmitterSignal a completion.- Specified by:
onCompletein interfaceEmitter<T>
-
setDisposable
Description copied from interface:ObservableEmitterSets aDisposableon this emitter; any previousDisposableorCancellablewill be disposed/cancelled.This method is thread-safe.
- Specified by:
setDisposablein interfaceObservableEmitter<T>- Parameters:
d- theDisposable,nullis allowed
-
setCancellable
Description copied from interface:ObservableEmitterSets aCancellableon this emitter; any previousDisposableorCancellablewill be disposed/cancelled.This method is thread-safe.
- Specified by:
setCancellablein interfaceObservableEmitter<T>- Parameters:
c- theCancellableresource,nullis allowed
-
serialize
Description copied from interface:ObservableEmitterEnsures that calls toonNext,onErrorandonCompleteare properly serialized.- Specified by:
serializein interfaceObservableEmitter<T>- Returns:
- the serialized
ObservableEmitter
-
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:ObservableEmitterReturns true if the downstream disposed the sequence or the emitter was terminated viaEmitter.onError(Throwable),Emitter.onComplete()or a successfulObservableEmitter.tryOnError(Throwable).This method is thread-safe.
- Specified by:
isDisposedin interfaceDisposable- Specified by:
isDisposedin interfaceObservableEmitter<T>- Returns:
- true if the downstream disposed the sequence or the emitter was terminated
-
toString
- Overrides:
toStringin classAtomicReference<Disposable>
-