Package org.reactivestreams
Class FlowAdapters.ReactiveToFlowSubscription
- java.lang.Object
-
- org.reactivestreams.FlowAdapters.ReactiveToFlowSubscription
-
- All Implemented Interfaces:
Subscription
- Enclosing class:
- FlowAdapters
static final class FlowAdapters.ReactiveToFlowSubscription extends java.lang.Object implements Subscription
Wraps a Flow Subscription and converts the calls to a Reactive Streams Subscription.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.concurrent.Flow.Subscriptionflow
-
Constructor Summary
Constructors Constructor Description ReactiveToFlowSubscription(java.util.concurrent.Flow.Subscription flow)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Request thePublisherto stop sending data and clean up resources.voidrequest(long n)No events will be sent by aPublisheruntil demand is signaled via this method.
-
-
-
Method Detail
-
request
public void request(long n)
Description copied from interface:SubscriptionNo events will be sent by aPublisheruntil demand is signaled via this method.It can be called however often and whenever needed—but if the outstanding cumulative demand ever becomes Long.MAX_VALUE or more, it may be treated by the
Publisheras "effectively unbounded".Whatever has been requested can be sent by the
Publisherso only signal demand for what can be safely handled.A
Publishercan send less than is requested if the stream ends but then must emit eitherSubscriber.onError(Throwable)orSubscriber.onComplete().- Specified by:
requestin interfaceSubscription- Parameters:
n- the strictly positive number of elements to requests to the upstreamPublisher
-
cancel
public void cancel()
Description copied from interface:SubscriptionRequest thePublisherto stop sending data and clean up resources.Data may still be sent to meet previously signalled demand after calling cancel.
- Specified by:
cancelin interfaceSubscription
-
-