| Modifier and Type | Field and Description |
|---|---|
| public static final SubscriptionHelper | CANCELLED
Represents a cancelled Subscription. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | cancel()
Implements org. Publisher to stop sending data and clean up resources.
|
| public static boolean | Returns: true if the swap from the non-cancelled instance to the common cancelled instance happened in the caller's thread (allows further one-time actions).the target field to dispose the contents of field)Atomically swaps in the common cancelled subscription instance and cancels the previous subscription if any. |
| public static void | deferredRequest(AtomicReference<Subscription>
the target field that may already contain a Subscription field, AtomicLong the current requested amount requested, long the request amount, positive (verified) n)Atomically requests from the Subscription in the field if not null, otherwise accumulates the request amount in the requested field to be requested once the field is set to non-null. |
| public static boolean | Returns: true if the Subscription was set the first timethe target field for the new Subscription field, AtomicLong the current requested amount requested, Subscription the new Subscription, not null (verified) s)Atomically sets the new Subscription on the field and requests any accumulated amount from the requested field. |
| public static boolean | Returns: true if the operation succeeded, false if the target field holds theCANCELLED instance.the target field to set the new subscription on field, Subscription the new subscription s)Atomically sets the subscription on the field but does not cancel the previous subscription. |
| public static void | reportMoreProduced(long
the overproduction amount n)Reports to the plugin error handler that there were more values produced than requested, which is a sign of internal backpressure handling bug. |
| public static void | reportSubscriptionSet()
Reports that the subscription is already set to the RxJavaPlugins error handler, which is an indication of a onSubscribe management bug. |
| 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.
|
| public static boolean | Returns: true if the operation succeeded, false if the target field holds theCANCELLED instance.the target field to set the new subscription on field, Subscription the new subscription s)Atomically sets the subscription on the field and cancels the previous subscription if any. |
| public static boolean | Returns: true if the operation succeeded, false if the target field was not null.the target field field, Subscription the new subscription to set s)Atomically sets the subscription on the field if it is still null. |
| public static boolean | Returns: true if the operation succeeded, false if the target field was not null.the target field field, Subscription the new subscription to set s, long the amount to request, positive (not verified) request)Atomically sets the subscription on the field if it is still null and issues a positive request
to the given |
| public static boolean | Returns: true if the validation succeededthe current Subscription, expected to be null current, Subscription the next Subscription, expected to be non-null next)Verifies that current is null, next is not null, otherwise signals errors to the RxJavaPlugins and returns false. |
| public static boolean | Returns: false if n is non-positive.the request amount n)Validates that the n is positive. |
| public static SubscriptionHelper | |
| public static SubscriptionHelper[] |
| CANCELLED | back to summary |
|---|---|
| public static final SubscriptionHelper CANCELLED Represents a cancelled Subscription. Don't leak this instance! | |
| SubscriptionHelper | back to summary |
|---|---|
| private SubscriptionHelper() | |
| 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.
| |
| cancel | back to summary |
|---|---|
| public static boolean cancel(AtomicReference<Subscription> field) Atomically swaps in the common cancelled subscription instance and cancels the previous subscription if any.
| |
| deferredRequest | back to summary |
|---|---|
| public static void deferredRequest(AtomicReference<Subscription> field, AtomicLong requested, long n) Atomically requests from the Subscription in the field if not null, otherwise accumulates the request amount in the requested field to be requested once the field is set to non-null.
| |
| deferredSetOnce | back to summary |
|---|---|
| public static boolean deferredSetOnce(AtomicReference<Subscription> field, AtomicLong requested, Subscription s) Atomically sets the new Subscription on the field and requests any accumulated amount from the requested field.
| |
| replace | back to summary |
|---|---|
| public static boolean replace(AtomicReference<Subscription> field, Subscription s) Atomically sets the subscription on the field but does not cancel the previous subscription.
| |
| reportMoreProduced | back to summary |
|---|---|
| public static void reportMoreProduced(long n) Reports to the plugin error handler that there were more values produced than requested, which is a sign of internal backpressure handling bug.
| |
| reportSubscriptionSet | back to summary |
|---|---|
| public static void reportSubscriptionSet() Reports that the subscription is already set to the RxJavaPlugins error handler, which is an indication of a onSubscribe management bug. | |
| 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 | |
| set | back to summary |
|---|---|
| public static boolean set(AtomicReference<Subscription> field, Subscription s) Atomically sets the subscription on the field and cancels the previous subscription if any.
| |
| setOnce | back to summary |
|---|---|
| public static boolean setOnce(AtomicReference<Subscription> field, Subscription s) Atomically sets the subscription on the field if it is still null. If the field is not null and doesn't contain the
| |
| setOnce | back to summary |
|---|---|
| public static boolean setOnce(AtomicReference<Subscription> field, Subscription s, long request) Atomically sets the subscription on the field if it is still null and issues a positive request
to the given
If the field is not null and doesn't contain the
| |
| validate | back to summary |
|---|---|
| public static boolean validate(Subscription current, Subscription next) Verifies that current is null, next is not null, otherwise signals errors to the RxJavaPlugins and returns false.
| |
| validate | back to summary |
|---|---|
| public static boolean validate(long n) Validates that the n is positive.
| |
| valueOf | back to summary |
|---|---|
| public static SubscriptionHelper valueOf(String name) | |
| values | back to summary |
|---|---|
| public static SubscriptionHelper[] values() | |