T
- Type of value emitted by this PublisherSource.Subscription
.public final class ScalarValueSubscription<T> extends java.lang.Object implements PublisherSource.Subscription
PublisherSource.Subscription
that only emits a single value.IGNORE_CANCEL
Constructor and Description |
---|
ScalarValueSubscription(T value,
PublisherSource.Subscriber<? super T> subscriber)
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 ScalarValueSubscription(@Nullable T value, PublisherSource.Subscriber<? super T> subscriber)
value
- to be emitted by this PublisherSource.Subscription
.subscriber
- to emit the value to when requested.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