public final class DeferredEmptySubscription extends java.lang.Object implements PublisherSource.Subscription
PublisherSource.Subscription
that only emits a TerminalNotification
only upon the first call to
request(long)
.IGNORE_CANCEL
Constructor and Description |
---|
DeferredEmptySubscription(PublisherSource.Subscriber<?> subscriber,
TerminalNotification terminalNotification)
New instance.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Sends a hint to the producer of the associated asynchronous execution that the consumer related to this
Cancellable is not interested in the outcome of the execution. |
void |
request(long n)
Requests
n more items from the associated PublisherSource for the associated
PublisherSource.Subscriber . |
public DeferredEmptySubscription(PublisherSource.Subscriber<?> subscriber, TerminalNotification terminalNotification)
subscriber
- PublisherSource.Subscriber
to send the terminalNotification
.terminalNotification
- TerminalNotification
to send.public void request(long n)
PublisherSource.Subscription
n
more items from the associated PublisherSource
for the associated
PublisherSource.Subscriber
.
See Reactive Streams specifications for the rules about how and when this method will be invoked.
request
in interface PublisherSource.Subscription
n
- Number of items to request.public void cancel()
Cancellable
Cancellable
is not interested in the outcome of the execution.cancel
in interface Cancellable