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>downstreamThe actual subscriber.(package private) PublishSubject<T>parentThe subject state.private static longserialVersionUID
-
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 voiddispose()Dispose the resource, the operation should be idempotent.booleanisDisposed()Returns true if this resource has been disposed.voidonComplete()voidonError(java.lang.Throwable t)voidonNext(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: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
-
-