Class SingleTimeout.TimeoutMainObserver<T>
- java.lang.Object
-
- java.util.concurrent.atomic.AtomicReference<Disposable>
-
- io.reactivex.rxjava3.internal.operators.single.SingleTimeout.TimeoutMainObserver<T>
-
- All Implemented Interfaces:
SingleObserver<T>,Disposable,java.io.Serializable,java.lang.Runnable
- Enclosing class:
- SingleTimeout<T>
static final class SingleTimeout.TimeoutMainObserver<T> extends java.util.concurrent.atomic.AtomicReference<Disposable> implements SingleObserver<T>, java.lang.Runnable, Disposable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classSingleTimeout.TimeoutMainObserver.TimeoutFallbackObserver<T>
-
Field Summary
Fields Modifier and Type Field Description (package private) SingleObserver<? super T>downstream(package private) SingleTimeout.TimeoutMainObserver.TimeoutFallbackObserver<T>fallback(package private) SingleSource<? extends T>otherprivate static longserialVersionUID(package private) java.util.concurrent.atomic.AtomicReference<Disposable>task(package private) longtimeout(package private) java.util.concurrent.TimeUnitunit
-
Constructor Summary
Constructors Constructor Description TimeoutMainObserver(SingleObserver<? super T> actual, SingleSource<? extends T> other, long timeout, java.util.concurrent.TimeUnit unit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Dispose the resource, the operation should be idempotent.booleanisDisposed()Returns true if this resource has been disposed.voidonError(java.lang.Throwable e)Notifies theSingleObserverthat theSinglehas experienced an error condition.voidonSubscribe(Disposable d)Provides theSingleObserverwith the means of cancelling (disposing) the connection (channel) with the Single in both synchronous (from withinonSubscribe(Disposable)itself) and asynchronous manner.voidonSuccess(T t)Notifies theSingleObserverwith a single item and that theSinglehas finished sending push-based notifications.voidrun()-
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
-
downstream
final SingleObserver<? super T> downstream
-
task
final java.util.concurrent.atomic.AtomicReference<Disposable> task
-
fallback
final SingleTimeout.TimeoutMainObserver.TimeoutFallbackObserver<T> fallback
-
other
SingleSource<? extends T> other
-
timeout
final long timeout
-
unit
final java.util.concurrent.TimeUnit unit
-
-
Constructor Detail
-
TimeoutMainObserver
TimeoutMainObserver(SingleObserver<? super T> actual, SingleSource<? extends T> other, long timeout, java.util.concurrent.TimeUnit unit)
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
onSubscribe
public void onSubscribe(Disposable d)
Description copied from interface:SingleObserverProvides theSingleObserverwith the means of cancelling (disposing) the connection (channel) with the Single in both synchronous (from withinonSubscribe(Disposable)itself) and asynchronous manner.- Specified by:
onSubscribein interfaceSingleObserver<T>- Parameters:
d- the Disposable instance whoseDisposable.dispose()can be called anytime to cancel the connection
-
onSuccess
public void onSuccess(T t)
Description copied from interface:SingleObserverNotifies theSingleObserverwith a single item and that theSinglehas finished sending push-based notifications.The
Singlewill not call this method if it callsSingleObserver.onError(java.lang.Throwable).- Specified by:
onSuccessin interfaceSingleObserver<T>- Parameters:
t- the item emitted by theSingle
-
onError
public void onError(java.lang.Throwable e)
Description copied from interface:SingleObserverNotifies theSingleObserverthat theSinglehas experienced an error condition.If the
Singlecalls this method, it will not thereafter callSingleObserver.onSuccess(T).- Specified by:
onErrorin interfaceSingleObserver<T>- Parameters:
e- the exception encountered by theSingle
-
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
-
-