Package reactor.core.publisher
Class Operators.DeferredSubscription
java.lang.Object
reactor.core.publisher.Operators.DeferredSubscription
- All Implemented Interfaces:
Subscription,Scannable
- Enclosing class:
- Operators
public static class Operators.DeferredSubscription
extends Object
implements Subscription, Scannable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface reactor.core.Scannable
Scannable.Attr<T> -
Field Summary
Fields inherited from interface reactor.core.Scannable
OPERATOR_NAME_UNRELATED_WORDS_PATTERN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()protected booleanvoidrequest(long n) scanUnsafe(Scannable.Attr key) This method is used internally by components to define their key-value mappings in a single place.final booleanset(Subscription s) Atomically sets the single subscription and requests the missed amount from it.protected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface reactor.core.Scannable
actuals, inners, isScanAvailable, name, parents, scan, scanOrDefault, stepName, steps, tags, tagsDeduplicated
-
Constructor Details
-
DeferredSubscription
public DeferredSubscription()
-
-
Method Details
-
isCancelled
protected boolean isCancelled() -
cancel
public void cancel()- Specified by:
cancelin interfaceSubscription
-
terminate
protected void terminate() -
scanUnsafe
Description copied from interface:ScannableThis method is used internally by components to define their key-value mappings in a single place. Although it is ignoring the generic type of theScannable.Attrkey, implementors should take care to return values of the correct type, and return null if no specific value is available.For public consumption of attributes, prefer using
Scannable.scan(Attr), which will return a typed value and fall back to the key's default if the component didn't define any mapping.- Specified by:
scanUnsafein interfaceScannable- Parameters:
key- aScannable.Attrto resolve for the component.- Returns:
- the value associated to the key for that specific component, or null if none.
-
request
public void request(long n) - Specified by:
requestin interfaceSubscription
-
set
Atomically sets the single subscription and requests the missed amount from it.- Parameters:
s- the subscription to set- Returns:
- false if this arbiter is cancelled or there was a subscription already set
-