Class ScalarValueSubscription<T>
java.lang.Object
io.servicetalk.concurrent.internal.ScalarValueSubscription<T>
- Type Parameters:
T
- Type of value emitted by thisPublisherSource.Subscription
.
- All Implemented Interfaces:
Cancellable
,PublisherSource.Subscription
public final class ScalarValueSubscription<T>
extends Object
implements PublisherSource.Subscription
A
PublisherSource.Subscription
that only emits a single value.-
Field Summary
Fields inherited from interface io.servicetalk.concurrent.Cancellable
IGNORE_CANCEL
-
Constructor Summary
ConstructorDescriptionScalarValueSubscription
(T value, PublisherSource.Subscriber<? super T> subscriber) New instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Sends a hint to the producer of the associated asynchronous execution that the consumer related to thisCancellable
is not interested in the outcome of the execution.void
request
(long n) Requestsn
more items from the associatedPublisherSource
for the associatedPublisherSource.Subscriber
.
-
Constructor Details
-
ScalarValueSubscription
New instance.- Parameters:
value
- to be emitted by thisPublisherSource.Subscription
.subscriber
- to emit the value to when requested.
-
-
Method Details
-
request
public void request(long n) Description copied from interface:PublisherSource.Subscription
Requestsn
more items from the associatedPublisherSource
for the associatedPublisherSource.Subscriber
.See Reactive Streams specifications for the rules about how and when this method will be invoked.
- Specified by:
request
in interfacePublisherSource.Subscription
- Parameters:
n
- Number of items to request.
-
cancel
public void cancel()Description copied from interface:Cancellable
Sends a hint to the producer of the associated asynchronous execution that the consumer related to thisCancellable
is not interested in the outcome of the execution.- Specified by:
cancel
in interfaceCancellable
-