| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class | FlowablePublish.InnerSubscriber<
the value type T>A Subscription that manages the request and cancellation state of a child subscriber in thread-safe manner. |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final int | bufferSize
The size of the prefetch buffer. |
| pack-priv static final long | CANCELLED
Indicates this child has been cancelled: the state is swapped in atomically and will prevent the dispatch() to emit (too many) values to a terminated child subscriber. |
| pack-priv final AtomicReference | current
Holds the current subscriber that is, will be or just was subscribed to the source observable. |
| pack-priv final Publisher | |
| pack-priv final Flowable | source
The source observable. |
| Access | Constructor and Description |
|---|---|
| private | FlowablePublish(Publisher<T> onSubscribe, Flowable<T> source, final AtomicReference<FlowablePublish.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | connect(Consumer<? super Disposable>
the action that receives the connection subscription before the subscription to source happens
allowing the caller to synchronously disconnect a synchronous source connection)Implements abstract io. ConnectableFlowable to begin emitting the items from its underlying
Flowable to its Subscribers.
|
| public static < the source value type T> ConnectableFlowable | |
| public int | Returns: The internal buffer size of this FloawblePublish operator.Implements io. |
| public Publisher | publishSource()
Implements io. |
| public Publisher | source()
Implements io. |
| protected void | subscribeActual(Subscriber<? super T>
the incoming Subscriber, never null s)Implements abstract io. Subscribers.
|
| bufferSize | back to summary |
|---|---|
| pack-priv final int bufferSize The size of the prefetch buffer. | |
| CANCELLED | back to summary |
|---|---|
| pack-priv static final long CANCELLED Indicates this child has been cancelled: the state is swapped in atomically and will prevent the dispatch() to emit (too many) values to a terminated child subscriber. | |
| current | back to summary |
|---|---|
| pack-priv final AtomicReference<FlowablePublish. Holds the current subscriber that is, will be or just was subscribed to the source observable. | |
| onSubscribe | back to summary |
|---|---|
| pack-priv final Publisher<T> onSubscribe | |
| source | back to summary |
|---|---|
| pack-priv final Flowable<T> source The source observable. | |
| FlowablePublish | back to summary |
|---|---|
| private FlowablePublish(Publisher<T> onSubscribe, Flowable<T> source, final AtomicReference<FlowablePublish. | |
| connect | back to summary |
|---|---|
| public void connect(Consumer<? super Disposable> connection) Implements abstract io. Doc from io. Instructs the
| |
| create | back to summary |
|---|---|
| public static <T> ConnectableFlowable Creates a OperatorPublish instance to publish values of the given source observable.
| |
| publishBufferSize | back to summary |
|---|---|
| public int publishBufferSize() Implements io. The internal buffer size of this FloawblePublish operator.
| |
| publishSource | back to summary |
|---|---|
| public Publisher Implements io. Doc from io. The upstream source of this publish operator. | |
| source | back to summary |
|---|---|
| public Publisher Implements io. Doc from io. Returns the source Publisher. This method is intended to discover the assembly graph of sequences. | |
| subscribeActual | back to summary |
|---|---|
| protected void subscribeActual(Subscriber<? super T> s) Implements abstract io. Doc from io. Operator implementations (both source and intermediate) should implement this method that
performs the necessary business logic and handles the incoming There is no need to call any of the plugin hooks on the current
| |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final AtomicReference |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | subscribe(Subscriber<? super T>
the child)Subscriber that will consume signals from this PublisherImplements org. Publisher to start streaming data.
|
| bufferSize | back to summary |
|---|---|
| private final int bufferSize | |
| curr | back to summary |
|---|---|
| private final AtomicReference<FlowablePublish. | |
| FlowablePublisher | back to summary |
|---|---|
| pack-priv FlowablePublisher(AtomicReference<FlowablePublish. | |
| subscribe | back to summary |
|---|---|
| public void subscribe(Subscriber<? super T> child) Implements org. Doc from org. Request
This is a "factory method" and can be called multiple times, each time starting a new
Each
A
If the
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Subscriber | child
The actual child subscriber. |
| pack-priv long | emitted
Track the number of emitted items (avoids decrementing the request counter). |
| pack-priv volatile FlowablePublish. | parent
The parent subscriber-to-source used to allow removing the child in case of child cancellation. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | cancel()
Implements org. Publisher to stop sending data and clean up resources.
|
| public void | request(long
the strictly positive number of elements to requests to the upstream n)PublisherImplements org. Publisher until demand is signaled via this method.
|
| child | back to summary |
|---|---|
| pack-priv final Subscriber<? super T> child The actual child subscriber. | |
| emitted | back to summary |
|---|---|
| pack-priv long emitted Track the number of emitted items (avoids decrementing the request counter). | |
| parent | back to summary |
|---|---|
| pack-priv volatile FlowablePublish. The parent subscriber-to-source used to allow removing the child in case of child cancellation. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| InnerSubscriber | back to summary |
|---|---|
| pack-priv InnerSubscriber(Subscriber<? super T> child) | |
| cancel | back to summary |
|---|---|
| public void cancel() Implements org. Doc from org. Request the Data may still be sent to meet previously signalled demand after calling cancel.
| |
| request | back to summary |
|---|---|
| public void request(long n) Implements org. Doc from org. No events will be sent by a
It can be called however often and whenever needed—but if the outstanding cumulative demand ever becomes Long.MAX_VALUE or more,
it may be treated by the
Whatever has been requested can be sent by the
A | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final int | bufferSize
The prefetch buffer size. |
| pack-priv final AtomicReference | current
Holds onto the current connected PublishSubscriber. |
| pack-priv static final FlowablePublish. | EMPTY
Indicates an empty array of inner subscribers. |
| pack-priv volatile SimpleQueue | queue
Holds notifications from upstream. |
| private static final long | |
| pack-priv final AtomicBoolean | shouldConnect
Atomically changed from false to true by connect to make sure the connection is only performed by one thread. |
| pack-priv int | |
| pack-priv final AtomicReference | subscribers
Tracks the subscribed InnerSubscribers. |
| pack-priv volatile Object | terminalEvent
Contains either an onComplete or an onError token from upstream. |
| pack-priv static final FlowablePublish. | TERMINATED
Indicates a terminated PublishSubscriber. |
| pack-priv final AtomicReference |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | Returns: true if succeeded, false otherwisethe producer to add producerAtomically try adding a new InnerSubscriber to this Subscriber or return false if this Subscriber was terminated. |
| pack-priv boolean | Returns: true if there is indeed a terminal conditionthe terminal event (a NotificationLite.error or completed) term, boolean set to true if the queue is empty empty)Perform termination actions in case the source has terminated in some way and the queue has also become empty. |
| pack-priv void | dispatch()
The common serialization point of events arriving from upstream and child subscribers requesting more. |
| public void | dispose()
Implements io. |
| public boolean | isDisposed()
Implements io. |
| public void | |
| public void | onError(Throwable
the throwable signaled e)Implements org. |
| public void | onNext(T
the element signaled t)Implements org. Publisher in response to requests to Subscription#request(long).
|
| public void | onSubscribe(Subscription
the s)Subscription that allows requesting data via Subscription#request(long)Implements io. onNext(Object) is established before
calling Subscription#request(long).
|
| pack-priv void | remove(FlowablePublish.
the producer to remove producerAtomically removes the given InnerSubscriber from the subscribers array. |
| bufferSize | back to summary |
|---|---|
| pack-priv final int bufferSize The prefetch buffer size. | |
| current | back to summary |
|---|---|
| pack-priv final AtomicReference<FlowablePublish. Holds onto the current connected PublishSubscriber. | |
| EMPTY | back to summary |
|---|---|
| pack-priv static final FlowablePublish. Indicates an empty array of inner subscribers. | |
| queue | back to summary |
|---|---|
| pack-priv volatile SimpleQueue<T> queue Holds notifications from upstream. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| shouldConnect | back to summary |
|---|---|
| pack-priv final AtomicBoolean shouldConnect Atomically changed from false to true by connect to make sure the connection is only performed by one thread. | |
| sourceMode | back to summary |
|---|---|
| pack-priv int sourceMode | |
| subscribers | back to summary |
|---|---|
| pack-priv final AtomicReference<FlowablePublish. Tracks the subscribed InnerSubscribers. | |
| terminalEvent | back to summary |
|---|---|
| pack-priv volatile Object terminalEvent Contains either an onComplete or an onError token from upstream. | |
| TERMINATED | back to summary |
|---|---|
| pack-priv static final FlowablePublish. Indicates a terminated PublishSubscriber. | |
| upstream | back to summary |
|---|---|
| pack-priv final AtomicReference<Subscription> upstream | |
| PublishSubscriber | back to summary |
|---|---|
pack-priv PublishSubscriber(AtomicReference<FlowablePublish.
| |
| add | back to summary |
|---|---|
| pack-priv boolean add(FlowablePublish. Atomically try adding a new InnerSubscriber to this Subscriber or return false if this Subscriber was terminated.
| |
| checkTerminated | back to summary |
|---|---|
| pack-priv boolean checkTerminated(Object term, boolean empty) Perform termination actions in case the source has terminated in some way and the queue has also become empty.
| |
| dispatch | back to summary |
|---|---|
| pack-priv void dispatch() The common serialization point of events arriving from upstream and child subscribers requesting more. | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements io. Doc from io. Dispose the resource, the operation should be idempotent.
| |
| isDisposed | back to summary |
|---|---|
| public boolean isDisposed() Implements io. Doc from io. Returns true if this resource has been disposed.
| |
| onComplete | back to summary |
|---|---|
| public void onComplete() Implements org. Doc from org. Successful terminal state.
No further events will be sent even if
| |
| onError | back to summary |
|---|---|
| public void onError(Throwable e) Implements org. Doc from org. Failed terminal state.
No further events will be sent even if | |
| onNext | back to summary |
|---|---|
| public void onNext(T t) Implements org. Doc from org. Data notification sent by the
| |
| onSubscribe | back to summary |
|---|---|
| public void onSubscribe(Subscription s) Implements io. Doc from io. Implementors of this method should make sure everything that needs
to be visible in
No data will start flowing until
It is the responsibility of this
The
| |
| remove | back to summary |
|---|---|
| pack-priv void remove(FlowablePublish. Atomically removes the given InnerSubscriber from the subscribers array.
| |