Package io.reactivex.rxjava3.subjects
Class PublishSubject.PublishDisposable<T>
- java.lang.Object
-
- java.util.concurrent.atomic.AtomicBoolean
-
- io.reactivex.rxjava3.subjects.PublishSubject.PublishDisposable<T>
-
- Type Parameters:
T
- the value type
- All Implemented Interfaces:
Disposable
,java.io.Serializable
- Enclosing class:
- PublishSubject<T>
static final class PublishSubject.PublishDisposable<T> extends java.util.concurrent.atomic.AtomicBoolean implements Disposable
Wraps the actual subscriber, tracks its requests and makes cancellation to remove itself from the current subscribers array.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Observer<? super T>
downstream
The actual subscriber.(package private) PublishSubject<T>
parent
The subject state.private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description PublishDisposable(Observer<? super T> actual, PublishSubject<T> parent)
Constructs a PublishSubscriber, wraps the actual subscriber and the state.
-
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
onComplete()
void
onError(java.lang.Throwable t)
void
onNext(T t)
-
Methods inherited from class java.util.concurrent.atomic.AtomicBoolean
compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, get, getAcquire, getAndSet, getOpaque, getPlain, lazySet, set, setOpaque, setPlain, setRelease, toString, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
parent
final PublishSubject<T> parent
The subject state.
-
-
Constructor Detail
-
PublishDisposable
PublishDisposable(Observer<? super T> actual, PublishSubject<T> parent)
Constructs a PublishSubscriber, wraps the actual subscriber and the state.- Parameters:
actual
- the actual subscriberparent
- the parent PublishProcessor
-
-
Method Detail
-
onNext
public void onNext(T t)
-
onError
public void onError(java.lang.Throwable t)
-
onComplete
public void onComplete()
-
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
-
-