Subscription#request(long) handling.
Combine utils available to operator implementations, @see https://github.com/reactor/reactive-streams-commons
| Modifier and Type | Class and Description |
|---|---|
| pack-priv abstract static class | |
| pack-priv static class | |
| pack-priv static class | Operators.ConditionalSubscriberAdapter<
passed subscriber type T>This class wraps any non-conditional |
| pack-priv static class | |
| public static class | Operators.DeferredSubscription
Base class for Subscribers that will receive their Subscriptions at any time, yet they might also need to be cancelled or requested at any time. |
| pack-priv static class | |
| pack-priv static class | |
| pack-priv static class | |
| pack-priv static class | |
| public static class | Operators.MonoSubscriber<
The upstream sequence type I, The downstream sequence type O>A Subscriber/Subscription barrier that holds a single value at most and properly gates asynchronous behaviors resulting from concurrent request or cancel and onXXX signals. |
| pack-priv abstract static class | Operators.MultiSubscriptionSubscriber<
the input value type I, the output value type O>A subscription implementation that arbitrates request amounts between subsequent Subscriptions, including the duration until the first Subscription is set. |
| pack-priv static class | Operators.ScalarSubscription<
the value type T>Represents a fuseable Subscription that emits a single constant value synchronously to a Subscriber or consumer. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Fuseable. | |
| pack-priv static final Logger |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public static long | Returns: Addition result or Long.MAX_VALUE if overflowleft operand a, long right operand b)Cap an addition to Long.MAX_VALUE |
| public static < the parent instance type T> long | Returns: value before addition or Long.MAX_VALUEcurrent field updater updater, T current instance to update instance, long delta to add toAdd)Concurrent addition bound to Long.MAX_VALUE. |
| pack-priv static < the type of the field-bearing instance T> long | Returns: the old value of the field, before update.the field to update updater, T the instance bearing the field instance, long the value to add n)Add the amount |
| public static < the value type of the QueueSubscription. T> Fuseable. | Returns: the QueueSubscription instance or nullthe source subscription to try to convert. s)Returns the subscription as QueueSubscription if possible or null. |
| public static boolean | Returns: true if passed subscription is a subscription created inreportThrowInSubscribe(CoreSubscriber, Throwable).the subscription to test. subscription)Check whether the provided |
| public static Subscription | Returns: a singleton noopSubscription to be used as an inner representation
of the cancelled stateA singleton Subscription that represents a cancelled subscription instance and should not be leaked to clients as it represents a terminal state. |
| public static void | complete(Subscriber<?>
the target subscriber s)Calls onSubscribe on the target Subscriber with the empty instance followed by a call to onComplete. |
| pack-priv static final < element type R> Function | discardLocalAdapter(Class<R>
the type of elements to take into account type, Consumer<? super R> the discarding handler for this type of elements discardHook)Create an adapter for local onDiscard hooks that check the element
being discarded is of a given |
| public static <T> CoreSubscriber | Returns: a newSubscriber whose sole purpose is to request Long.MAXReturn a singleton |
| public static < the type of data (ignored) T> CoreSubscriber | Returns: a placeholder subscriberA |
| public static Subscription | Returns: a singleton noopSubscriptionA singleton enumeration that represents a no-op Subscription instance that can be freely given out to clients. |
| public static final Context | enableOnDiscard(Context
the original target, Consumer<?> Contextthe consumer that will be used to cleanup discarded elements discardConsumer)Utility method to activate the onDiscard feature (see |
| public static void | error(Subscriber<?>
target Subscriber to error s, Throwable the actual error e)Calls onSubscribe on the target Subscriber with the empty instance followed by a call to onError with the supplied error. |
| public static < the input type I, the output type O> Function | Returns: a newFunctionthe bifunction taking lifter)Scannable from the enclosing
publisher (assuming it is compatible) and consuming CoreSubscriber.
It must return a receiving CoreSubscriber that will immediately subscribe
to the applied Publisher.Create a function that can be used to support a custom operator via
|
| public static < the input and output type O> Function | Returns: a newFunctionthe predicate to match taking filter, BiFunction<Scannable, ? super CoreSubscriber<? super O>, ? extends CoreSubscriber<? super O>> Scannable from the applied
publisher to operate on. Assumes original is scan-compatible.the bifunction taking lifter)Scannable from the enclosing
publisher and consuming CoreSubscriber. It must return a receiving
CoreSubscriber that will immediately subscribe to the applied
Publisher. Assumes the original is scan-compatible.Create a function that can be used to support a custom operator via
|
| public static < the input type I, the output type O> Function | Returns: a newFunctionthe bifunction taking the raw lifter)Publisher and
CoreSubscriber. The publisher can be double-checked (including with
instanceof, and the function must return a receiving CoreSubscriber
that will immediately subscribe to the Publisher.Create a function that can be used to support a custom operator via
|
| public static < the input and output type O> Function | Returns: a newFunctionthe lifter)BiFunction taking the raw Publisher and
CoreSubscriber. The publisher can be double-checked (including with
instanceof, and the function must return a receiving CoreSubscriber
that will immediately subscribe to the Publisher.Create a function that can be used to support a custom operator via
|
| public static long | Returns: Product result or Long.MAX_VALUE if overflowleft operand a, long right operand b)Cap a multiplication to Long.MAX_VALUE |
| pack-priv static Context | |
| public static < the type of the element T> void | |
| public static void | onDiscardMultiple(Stream<?>
the collection of elements to discard (possibly extracted from other
collections/arrays/queues) multiple, Context the context)Context in which to look for local hookInvoke a (local or global) hook that processes elements that get discarded en masse. |
| public static void | onDiscardMultiple(Collection<?>
the collection of elements to discard multiple, Context the context)Context in which to look for local hookInvoke a (local or global) hook that processes elements that get discarded en masse. |
| public static void | onDiscardMultiple(Iterator<?>
the multiple, boolean Iterator whose remainder to discardis the caller guaranteeing that the iterator is finite and can be iterated over knownToBeFinite, Context the context)Context in which to look for local hookInvoke a (local or global) hook that processes elements that remains in an |
| public static void | onDiscardMultiple(Spliterator<?>
the multiple, boolean Spliterator whose remainder to discardis the caller guaranteeing that the iterator is finite and can be iterated over knownToBeFinite, Context the context)Context in which to look for local hookInvoke a (local or global) hook that processes elements that remains in an |
| public static < the type of the element T> void | onDiscardQueueWithClear(Queue<T>
the queue that is being discarded and cleared queue, Context the context in which to look for a local hook context, Function<T, Stream<?>> an optional extractor method for cases where the queue doesn't
directly contain the elements to discard extract)Invoke a (local or global) hook that processes elements that get discarded en masse after having been enqueued, due to cancellation or error. |
| public static void | onErrorDropped(Throwable
the dropped exception e, Context a context that might hold a local error consumer context)An unexpected exception is about to be dropped. |
| pack-priv static void | onErrorDroppedMulticast(Throwable
the dropped exception e, InnerProducer<?>[] the inner targets of the multicast multicastInners)An unexpected exception is about to be dropped from an operator that has multiple subscribers (and thus potentially multiple Context with local onErrorDropped handlers). |
| public static < the type of the value. T> CorePublisher | Returns: aCorePublisher to subscribe on.the original source)CorePublisher.Applies the hooks registered with |
| public static < the dropped value type T> void | onNextDropped(T
the dropped data t, Context a context that might hold a local next consumer context)An unexpected event is about to be dropped. |
| pack-priv static < the dropped value type T> void | onNextDroppedMulticast(T
the dropped data t, InnerProducer<?>[] the inner targets of the multicast multicastInners)An unexpected event is about to be dropped from an operator that has multiple subscribers (and thus potentially multiple Context with local onNextDropped handlers). |
| public static < The type of the value causing the error. T> Throwable | Returns: aThrowable to propagate through onError if the strategy is
terminal and cancelled the subscription, null if not.The onNext value that caused an error. Can be null. value, Throwable The error. error, Context The most significant context, Subscription Context in which to look for an OnNextFailureStrategy.The mandatory subscriptionForCancel)Subscription that should be cancelled if the
strategy is terminal. See also onNextError(Object, Throwable, Context) and
onNextPollError(Object, Throwable, Context) for alternatives that don't cancel a subscriptionFind the |
| public static < The type of the value causing the error. T> Throwable | Returns: aThrowable to propagate through onError if the strategy is terminal, null if not.The onNext value that caused an error. value, Throwable The error. error, Context The most significant context)Context in which to look for an OnNextFailureStrategy.Find the |
| public static final BiFunction | |
| pack-priv static final OnNextFailureStrategy | |
| public static < The type of the value causing the error. T> Throwable | Returns: aThrowable to propagate through onError if the strategy is
terminal and cancelled the subscription, null if not.The error. error, Context The most significant context, Subscription Context in which to look for an OnNextFailureStrategy.The subscriptionForCancel)Subscription that should be cancelled if the
strategy is terminal. Null to ignore (for poll, use onNextPollError(Object, Throwable, Context)
rather than passing null).Find the |
| public static < The type of the value causing the error. T> RuntimeException | Returns: aRuntimeException to be thrown (eg. within Queue#poll() if the error is terminal in
the strategy, null if not.The onNext value that caused an error. value, Throwable The error. error, Context The most significant context)Context in which to look for an OnNextFailureStrategy.Find the |
| public static Throwable | Returns: mappedThrowablethe callback or operator error error, Context a context that might hold a local error consumer context)Map an "operator" error. |
| public static Throwable | Returns: mappedThrowablethe linked operator parent subscription, Throwable Subscriptionthe callback or operator error error, Context a context that might hold a local error consumer context)Map an "operator" error given an operator parent |
| public static Throwable | Returns: mappedThrowablethe linked operator parent subscription, Throwable Subscriptionthe callback or operator error error, Object the value (onNext or onError) signal processed during failure dataSignal, Context a context that might hold a local error consumer context)Map an "operator" error given an operator parent |
| public static RuntimeException | onRejectedExecution(Throwable
the original execution error original, Context a context that might hold a local error consumer context)Return a wrapped |
| public static RuntimeException | onRejectedExecution(Throwable
the original execution error original, Subscription the subscription to pass to onOperatorError. subscription, Throwable a Throwable to be suppressed by the suppressed, Object RejectedExecutionException (or null if not relevant)a value to be passed to dataSignal, Context onOperatorError(Subscription, Throwable, Object, Context) (or null if not relevant)a context that might hold a local error consumer context)Return a wrapped |
| public static < the parent instance type T> long | Returns: value after subtraction or zerocurrent field updater updater, T current instance to update instance, long delta to subtract toSub)Concurrent subtraction bound to 0, mostly used to decrement a request tracker by the amount produced by the operator. |
| pack-priv static <T> long | |
| public static < the instance type F> boolean | Returns: true if replacedThe Atomic container field, F the instance reference instance, Subscription the subscription s)A generic utility to atomically replace a subscription or cancel the replacement
if the current subscription is marked as already cancelled (as in
|
| public static void | reportBadRequest(long
the failing demand n)Log an |
| public static void | reportMoreProduced()
Log an |
| public static void | |
| public static void | reportThrowInSubscribe(CoreSubscriber<?>
the subscriber, Throwable Subscriber being subscribed when the error happenedthe e)Throwable that was thrown from Publisher#subscribe(Subscriber)Report a
|
| pack-priv static <T> CoreSubscriber | |
| pack-priv static <T> CoreSubscriber | restoreContextOnSubscriberIfAutoCPEnabled(Publisher<?> publisher, CoreSubscriber<? super T> subscriber)
|
| pack-priv static <T> CoreSubscriber | restoreContextOnSubscriberIfPublisherNonInternal(Publisher<?> publisher, CoreSubscriber<T> subscriber)
|
| pack-priv static <T> CoreSubscriber | |
| public static < the value type T> Subscription | Returns: a new scalarSubscriptionthe delegate subscriber, T Subscriber that will be requesting the valuethe single value to be emitted value)Represents a fuseable Subscription that emits a single constant value synchronously to a Subscriber or consumer. |
| public static < the value type T> Subscription | Returns: a new scalarSubscriptionthe delegate subscriber, T Subscriber that will be requesting the valuethe single value to be emitted value, String stepName)Represents a fuseable Subscription that emits a single constant value synchronously to a Subscriber or consumer. |
| public static < the relayed type T> CoreSubscriber | Returns: a serializingSubscriberthe subscriber to serialize subscriber)Safely gate a |
| public static < the instance type F> boolean | Returns: true if replacedThe Atomic container field, F the instance reference instance, Subscription the subscription s)A generic utility to atomically replace a subscription or cancel the replacement
if current subscription is marked as cancelled (as in |
| public static < the instance type containing the field F> boolean | Returns: true if successful, false if the target was not empty or has been cancelledthe field accessor field, F the parent instance instance, Subscription the subscription to set once s)Sets the given subscription once and returns true if successful, false if the field has a subscription already or has been cancelled. |
| public static long | Returns: Subtraction result or 0 if overflowleft operand a, long right operand b)Cap a subtraction to 0 |
| public static < the instance type containing the field F> boolean | Returns: true if terminated, false if the subscription was already terminatedthe field accessor field, F the parent instance instance)Atomically terminates the subscription if it is not already a
|
| public static < passed subscriber type T> Fuseable. | Returns: a potentially adaptedreactor.the actual)Subscriber to adaptIf the actual |
| public static < passed subscriber type T> CoreSubscriber | Returns: an eventually transformedSubscriberthe actual)Subscriber to apply hook onIf the actual |
| public static <T> CorePublisher | |
| public static <T> void | |
| pack-priv static int | |
| pack-priv static int | |
| pack-priv static long | |
| private static Throwable | |
| public static boolean | Returns: true if Subscription can be usedcurrent Subscription, expected to be null current, Subscription new Subscription next)Check Subscription current state and cancel new Subscription if current is set, or return true if ready to subscribe. |
| public static boolean | Returns: true if validthe request value n)Evaluate if a request is strictly positive otherwise |