Package io.servicetalk.concurrent.api
Class DeferredEmptySubscription
- java.lang.Object
-
- io.servicetalk.concurrent.api.DeferredEmptySubscription
-
- All Implemented Interfaces:
Cancellable,PublisherSource.Subscription
public final class DeferredEmptySubscription extends java.lang.Object implements PublisherSource.Subscription
AnPublisherSource.Subscriptionthat only emits aTerminalNotificationonly upon the first call torequest(long).
-
-
Field Summary
-
Fields inherited from interface io.servicetalk.concurrent.Cancellable
IGNORE_CANCEL
-
-
Constructor Summary
Constructors Constructor Description DeferredEmptySubscription(PublisherSource.Subscriber<?> subscriber, TerminalNotification terminalNotification)New instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Sends a hint to the producer of the associated asynchronous execution that the consumer related to thisCancellableis not interested in the outcome of the execution.voidrequest(long n)Requestsnmore items from the associatedPublisherSourcefor the associatedPublisherSource.Subscriber.
-
-
-
Constructor Detail
-
DeferredEmptySubscription
public DeferredEmptySubscription(PublisherSource.Subscriber<?> subscriber, TerminalNotification terminalNotification)
New instance.- Parameters:
subscriber-PublisherSource.Subscriberto send theterminalNotification.terminalNotification-TerminalNotificationto send.
-
-
Method Detail
-
request
public void request(long n)
Description copied from interface:PublisherSource.SubscriptionRequestsnmore items from the associatedPublisherSourcefor the associatedPublisherSource.Subscriber.See Reactive Streams specifications for the rules about how and when this method will be invoked.
- Specified by:
requestin interfacePublisherSource.Subscription- Parameters:
n- Number of items to request.
-
cancel
public void cancel()
Description copied from interface:CancellableSends a hint to the producer of the associated asynchronous execution that the consumer related to thisCancellableis not interested in the outcome of the execution.- Specified by:
cancelin interfaceCancellable
-
-