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 class
SingleTimeout.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>
other
private static long
serialVersionUID
(package private) java.util.concurrent.atomic.AtomicReference<Disposable>
task
(package private) long
timeout
(package private) java.util.concurrent.TimeUnit
unit
-
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 void
dispose()
Dispose the resource, the operation should be idempotent.boolean
isDisposed()
Returns true if this resource has been disposed.void
onError(java.lang.Throwable e)
Notifies theSingleObserver
that theSingle
has experienced an error condition.void
onSubscribe(Disposable d)
Provides theSingleObserver
with the means of cancelling (disposing) the connection (channel) with the Single in both synchronous (from withinonSubscribe(Disposable)
itself) and asynchronous manner.void
onSuccess(T t)
Notifies theSingleObserver
with a single item and that theSingle
has finished sending push-based notifications.void
run()
-
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:
run
in interfacejava.lang.Runnable
-
onSubscribe
public void onSubscribe(Disposable d)
Description copied from interface:SingleObserver
Provides theSingleObserver
with the means of cancelling (disposing) the connection (channel) with the Single in both synchronous (from withinonSubscribe(Disposable)
itself) and asynchronous manner.- Specified by:
onSubscribe
in 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:SingleObserver
Notifies theSingleObserver
with a single item and that theSingle
has finished sending push-based notifications.The
Single
will not call this method if it callsSingleObserver.onError(java.lang.Throwable)
.- Specified by:
onSuccess
in interfaceSingleObserver<T>
- Parameters:
t
- the item emitted by theSingle
-
onError
public void onError(java.lang.Throwable e)
Description copied from interface:SingleObserver
Notifies theSingleObserver
that theSingle
has experienced an error condition.If the
Single
calls this method, it will not thereafter callSingleObserver.onSuccess(T)
.- Specified by:
onError
in interfaceSingleObserver<T>
- Parameters:
e
- the exception encountered by theSingle
-
dispose
public void dispose()
Description copied from interface:Disposable
Dispose the resource, the operation should be idempotent.- Specified by:
dispose
in interfaceDisposable
-
isDisposed
public boolean isDisposed()
Description copied from interface:Disposable
Returns true if this resource has been disposed.- Specified by:
isDisposed
in interfaceDisposable
- Returns:
- true if this resource has been disposed
-
-