After a Subscriber calls an Observable's subscribe method, the
Observable calls the Subscriber's onNext method to emit items. A well-behaved
Observable will call a Subscriber's onCompleted method exactly once or the Subscriber's
onError method exactly once.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | |
| private Producer | |
| private long | |
| private final Subscriber | |
| private final SubscriptionList |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | Subscriber(Subscriber<?>
the other Subscriber subscriber)Construct a Subscriber by using another Subscriber for backpressure and
for holding the subscription list (when |
| protected | Subscriber(Subscriber<?>
the other Subscriber subscriber, boolean true to share the subscription list in subscriber with
this instanceConstruct a Subscriber by using another Subscriber for backpressure and
optionally for holding the subscription list (if
|
| Modifier and Type | Method and Description |
|---|---|
| public final void | add(Subscription
the s)Subscription to addAdds a |
| private void | |
| public final boolean | Returns: true if this Subscriber has unsubscribed from its subscriptions, false otherwiseImplements rx. |
| public void | onStart()
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. |
| protected final void | request(long
the maximum number of items you want the Observable to emit to the Subscriber at this time, or
n)Long.MAX_VALUE if you want the Observable to emit items at its own paceRequest a certain maximum number of emitted items from the Observable this Subscriber is subscribed to. |
| public void | setProducer(Producer
producer to be used by this subscriber or the other subscriber
(or recursively its other subscriber) to make requests from p)If other subscriber is set (by calling constructor
|
| public final void | unsubscribe()
Implements rx. Subscriber that was registered when this Subscription
was received.
|
| NOT_SET | back to summary |
|---|---|
| private static final long NOT_SET | |
| producer | back to summary |
|---|---|
| private Producer producer | |
| requested | back to summary |
|---|---|
| private long requested | |
| subscriber | back to summary |
|---|---|
| private final Subscriber<?> subscriber | |
| subscriptions | back to summary |
|---|---|
| private final SubscriptionList subscriptions | |
| Subscriber | back to summary |
|---|---|
| protected Subscriber() | |
| Subscriber | back to summary |
|---|---|
| protected Subscriber(Subscriber<?> subscriber) Construct a Subscriber by using another Subscriber for backpressure and
for holding the subscription list (when
| |
| Subscriber | back to summary |
|---|---|
| protected Subscriber(Subscriber<?> subscriber, boolean shareSubscriptions) Construct a Subscriber by using another Subscriber for backpressure and
optionally for holding the subscription list (if
To retain the chaining of subscribers when setting
| |
| add | back to summary |
|---|---|
| public final void add(Subscription s) Adds a
| |
| addToRequested | back to summary |
|---|---|
| private void addToRequested(long n) | |
| isUnsubscribed | back to summary |
|---|---|
| public final boolean isUnsubscribed() Implements rx. Indicates whether this Subscriber has unsubscribed from its list of subscriptions.
| |
| onStart | back to summary |
|---|---|
| public void onStart() 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. | |
| request | back to summary |
|---|---|
| protected final void request(long n) Request a certain maximum number of emitted items from the Observable this Subscriber is subscribed to.
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);
| |
| setProducer | back to summary |
|---|---|
| public void setProducer(Producer p) If other subscriber is set (by calling constructor
| |
| unsubscribe | back to summary |
|---|---|
| public final void unsubscribe() Implements rx. Doc from rx. Stops the receipt of notifications on the
This allows deregistering an
| |