Class FlowablePublish.PublishConnection<T>
- java.lang.Object
-
- java.lang.Number
-
- java.util.concurrent.atomic.AtomicInteger
-
- io.reactivex.rxjava3.internal.operators.flowable.FlowablePublish.PublishConnection<T>
-
- All Implemented Interfaces:
FlowableSubscriber<T>,Disposable,java.io.Serializable,org.reactivestreams.Subscriber<T>
- Enclosing class:
- FlowablePublish<T>
static final class FlowablePublish.PublishConnection<T> extends java.util.concurrent.atomic.AtomicInteger implements FlowableSubscriber<T>, Disposable
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intbufferSize(package private) java.util.concurrent.atomic.AtomicBooleanconnect(package private) intconsumed(package private) java.util.concurrent.atomic.AtomicReference<FlowablePublish.PublishConnection<T>>current(package private) booleandone(package private) static FlowablePublish.InnerSubscription[]EMPTY(package private) java.lang.Throwableerror(package private) SimpleQueue<T>queueprivate static longserialVersionUID(package private) intsourceMode(package private) java.util.concurrent.atomic.AtomicReference<FlowablePublish.InnerSubscription<T>[]>subscribers(package private) static FlowablePublish.InnerSubscription[]TERMINATED(package private) java.util.concurrent.atomic.AtomicReference<org.reactivestreams.Subscription>upstream
-
Constructor Summary
Constructors Constructor Description PublishConnection(java.util.concurrent.atomic.AtomicReference<FlowablePublish.PublishConnection<T>> current, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) booleanadd(FlowablePublish.InnerSubscription<T> inner)(package private) booleancheckTerminated(boolean isDone, boolean isEmpty)voiddispose()Dispose the resource, the operation should be idempotent.(package private) voiddrain()booleanisDisposed()Returns true if this resource has been disposed.voidonComplete()voidonError(java.lang.Throwable t)voidonNext(T t)voidonSubscribe(org.reactivestreams.Subscription s)Implementors of this method should make sure everything that needs to be visible inSubscriber.onNext(Object)is established before callingSubscription.request(long).(package private) voidremove(FlowablePublish.InnerSubscription<T> inner)(package private) voidsignalError(java.lang.Throwable ex)-
Methods inherited from class java.util.concurrent.atomic.AtomicInteger
accumulateAndGet, addAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAcquire, getAndAccumulate, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, getAndUpdate, getOpaque, getPlain, incrementAndGet, intValue, lazySet, longValue, set, setOpaque, setPlain, setRelease, toString, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
current
final java.util.concurrent.atomic.AtomicReference<FlowablePublish.PublishConnection<T>> current
-
upstream
final java.util.concurrent.atomic.AtomicReference<org.reactivestreams.Subscription> upstream
-
connect
final java.util.concurrent.atomic.AtomicBoolean connect
-
subscribers
final java.util.concurrent.atomic.AtomicReference<FlowablePublish.InnerSubscription<T>[]> subscribers
-
bufferSize
final int bufferSize
-
queue
volatile SimpleQueue<T> queue
-
sourceMode
int sourceMode
-
done
volatile boolean done
-
error
java.lang.Throwable error
-
consumed
int consumed
-
EMPTY
static final FlowablePublish.InnerSubscription[] EMPTY
-
TERMINATED
static final FlowablePublish.InnerSubscription[] TERMINATED
-
-
Constructor Detail
-
PublishConnection
PublishConnection(java.util.concurrent.atomic.AtomicReference<FlowablePublish.PublishConnection<T>> current, int bufferSize)
-
-
Method Detail
-
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
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription s)
Description copied from interface:FlowableSubscriberImplementors of this method should make sure everything that needs to be visible inSubscriber.onNext(Object)is established before callingSubscription.request(long). In practice this means no initialization should happen after therequest()call and additional behavior is thread safe in respect toonNext.- Specified by:
onSubscribein interfaceFlowableSubscriber<T>- Specified by:
onSubscribein interfaceorg.reactivestreams.Subscriber<T>
-
onError
public void onError(java.lang.Throwable t)
- Specified by:
onErrorin interfaceorg.reactivestreams.Subscriber<T>
-
onComplete
public void onComplete()
- Specified by:
onCompletein interfaceorg.reactivestreams.Subscriber<T>
-
drain
void drain()
-
checkTerminated
boolean checkTerminated(boolean isDone, boolean isEmpty)
-
signalError
void signalError(java.lang.Throwable ex)
-
add
boolean add(FlowablePublish.InnerSubscription<T> inner)
-
remove
void remove(FlowablePublish.InnerSubscription<T> inner)
-
-