| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | OperatorPublish.InnerProducer<
the value type T>A Producer and Subscription that manages the request and unsubscription state of a child subscriber in thread-safe manner. |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final AtomicReference | current
Holds the current subscriber that is, will be or just was subscribed to the source observable. |
| pack-priv final Observable | source
The source observable. |
| Access | Constructor and Description |
|---|---|
| private | OperatorPublish(Observable.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | connect(Action1<? super Subscription>
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 rx. ConnectableObservable to begin emitting the items from its underlying
Observable to its Subscribers.
|
| public static < the value type T> ConnectableObservable | Returns: the connectable observablethe source observable source)Creates a OperatorPublish instance to publish values of the given source observable. |
| public static <T, R> Observable | create(final Observable<? extends T> source, final Func1<? super Observable<T>, ? extends Observable<R>> selector)
|
| public static <T, R> Observable | create(final Observable<? extends T> source, final Func1<? super Observable<T>, ? extends Observable<R>> selector, final boolean delayError)
|
| current | back to summary |
|---|---|
| pack-priv final AtomicReference<OperatorPublish. Holds the current subscriber that is, will be or just was subscribed to the source observable. | |
| source | back to summary |
|---|---|
| pack-priv final Observable<? extends T> source The source observable. | |
| OperatorPublish | back to summary |
|---|---|
| private OperatorPublish(Observable. | |
| connect | back to summary |
|---|---|
| public void connect(Action1<? super Subscription> connection) Implements abstract rx. Doc from rx. Instructs the
| |
| create | back to summary |
|---|---|
| public static <T> ConnectableObservable Creates a OperatorPublish instance to publish values of the given source observable.
| |
| create | back to summary |
|---|---|
| public static <T, R> Observable | |
| create | back to summary |
|---|---|
| public static <T, R> Observable | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Subscriber | child
The actual child subscriber. |
| pack-priv static final long | NOT_REQUESTED
Indicates this child has not yet requested any value. |
| pack-priv final OperatorPublish. | parent
The parent subscriber-to-source used to allow removing the child in case of child unsubscription. |
| private static final long | |
| pack-priv static final long | UNSUBSCRIBED
Indicates this child has been unsubscribed: the state is swapped in atomically and will prevent the dispatch() to emit (too many) values to a terminated child subscriber. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | isUnsubscribed()
Implements rx. Subscription is currently unsubscribed.
|
| public long | Returns: the updated request value (may indicate how much can be produced or a terminal state)the number of items emitted n)Indicate that values have been emitted to this child subscriber by the dispatch() method. |
| public void | request(long
the maximum number of items you want this Producer to produce, or n)Long.MAX_VALUE if you
want the Producer to produce items at its own paceImplements rx. |
| public void | unsubscribe()
Implements rx. Subscriber that was registered when this Subscription
was received.
|
| child | back to summary |
|---|---|
| pack-priv final Subscriber<? super T> child The actual child subscriber. | |
| NOT_REQUESTED | back to summary |
|---|---|
| pack-priv static final long NOT_REQUESTED Indicates this child has not yet requested any value. We pretend we don't see such child subscribers in dispatch() to allow other child subscribers who have requested to make progress. In a concurrent subscription scenario, one can't be sure when a subscription happens exactly so this virtual shift should not cause any problems. | |
| parent | back to summary |
|---|---|
| pack-priv final OperatorPublish. The parent subscriber-to-source used to allow removing the child in case of child unsubscription. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| UNSUBSCRIBED | back to summary |
|---|---|
| pack-priv static final long UNSUBSCRIBED Indicates this child has been unsubscribed: the state is swapped in atomically and will prevent the dispatch() to emit (too many) values to a terminated child subscriber. | |
| InnerProducer | back to summary |
|---|---|
| public InnerProducer(OperatorPublish. | |
| isUnsubscribed | back to summary |
|---|---|
| public boolean isUnsubscribed() Implements rx. Doc from rx. Indicates whether this
| |
| produced | back to summary |
|---|---|
| public long produced(long n) Indicate that values have been emitted to this child subscriber by the dispatch() method.
| |
| request | back to summary |
|---|---|
| public void request(long n) Implements rx. Doc from rx. Request a certain maximum number of items from this Producer. This is a way of requesting backpressure.
To disable backpressure, pass
Requests are additive but if a sequence of requests totals more than request(100); request(Long.MAX_VALUE-1);
| |
| unsubscribe | back to summary |
|---|---|
| public void unsubscribe() Implements rx. Doc from rx. Stops the receipt of notifications on the
This allows deregistering an
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final AtomicReference | current
Holds onto the current connected PublishSubscriber. |
| pack-priv boolean | emitting
Guarded by this. |
| pack-priv static final OperatorPublish. | EMPTY
Indicates an empty array of inner producers. |
| pack-priv boolean | missed
Guarded by this. |
| pack-priv final AtomicReference | producers
Tracks the subscribed producers. |
| pack-priv final Queue | queue
Holds notifications from upstream. |
| 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 volatile Object | terminalEvent
Contains either an onCompleted or an onError token from upstream. |
| pack-priv static final OperatorPublish. | TERMINATED
Indicates a terminated PublishSubscriber. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv boolean | Returns: true if succeeded, false otherwisethe producer to add producerAtomically try adding a new InnerProducer 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. |
| pack-priv void | |
| public void | onCompleted()
Implements rx. Observable has finished sending push-based notifications.
|
| public void | onError(Throwable
the exception encountered by the Observable e)Implements rx. Observable has experienced an error condition.
|
| public void | onNext(T
the item emitted by the Observable t)Implements rx. |
| public void | onStart()
Overrides rx. |
| pack-priv void | remove(OperatorPublish.
the producer to remove producerAtomically removes the given producer from the producers array. |
| current | back to summary |
|---|---|
| pack-priv final AtomicReference<OperatorPublish. Holds onto the current connected PublishSubscriber. | |
| emitting | back to summary |
|---|---|
| pack-priv boolean emitting Guarded by this. | |
| EMPTY | back to summary |
|---|---|
| pack-priv static final OperatorPublish. Indicates an empty array of inner producers. | |
| missed | back to summary |
|---|---|
| pack-priv boolean missed Guarded by this. | |
| producers | back to summary |
|---|---|
| pack-priv final AtomicReference<OperatorPublish. Tracks the subscribed producers. | |
| queue | back to summary |
|---|---|
| pack-priv final Queue<Object> queue Holds notifications from upstream. | |
| 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. | |
| terminalEvent | back to summary |
|---|---|
| pack-priv volatile Object terminalEvent Contains either an onCompleted or an onError token from upstream. | |
| TERMINATED | back to summary |
|---|---|
| pack-priv static final OperatorPublish. Indicates a terminated PublishSubscriber. | |
| PublishSubscriber | back to summary |
|---|---|
| public PublishSubscriber(AtomicReference<OperatorPublish. | |
| add | back to summary |
|---|---|
| pack-priv boolean add(OperatorPublish. Atomically try adding a new InnerProducer 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. | |
| init | back to summary |
|---|---|
| pack-priv void init() Should be called after the constructor finished to setup nulling-out the current reference. | |
| onCompleted | back to summary |
|---|---|
| public void onCompleted() Implements rx. Doc from rx. Notifies the Observer that the
The
| |
| onError | back to summary |
|---|---|
| public void onError(Throwable e) Implements rx. Doc from rx. Notifies the Observer that the
If the | |
| onNext | back to summary |
|---|---|
| public void onNext(T t) Implements rx. Doc from rx. Provides the Observer with a new item to observe.
The
The
| |
| onStart | back to summary |
|---|---|
| public void onStart() Overrides rx. Doc from rx. This method is invoked when the Subscriber and Observable have been connected but the Observable has not yet begun to emit items or send notifications to the Subscriber. Override this method to add any useful initialization to your subscription, for instance to initiate backpressure.
| |
| remove | back to summary |
|---|---|
| pack-priv void remove(OperatorPublish. Atomically removes the given producer from the producers array.
| |