Class AsyncBufferingSubscriber<T>
java.lang.Object
software.amazon.awssdk.transfer.s3.internal.AsyncBufferingSubscriber<T>
- Type Parameters:
T
- Type of data requested
- All Implemented Interfaces:
org.reactivestreams.Subscriber<T>
public class AsyncBufferingSubscriber<T>
extends Object
implements org.reactivestreams.Subscriber<T>
An implementation of
Subscriber
that execute the provided function for every event and limits the number of concurrent
function execution to the given maxConcurrentRequests
-
Constructor Summary
ConstructorsConstructorDescriptionAsyncBufferingSubscriber
(Function<T, CompletableFuture<?>> consumer, CompletableFuture<Void> returnFuture, int maxConcurrentExecutions) -
Method Summary
Modifier and TypeMethodDescriptionint
void
void
void
void
onSubscribe
(org.reactivestreams.Subscription subscription)
-
Constructor Details
-
AsyncBufferingSubscriber
public AsyncBufferingSubscriber(Function<T, CompletableFuture<?>> consumer, CompletableFuture<Void> returnFuture, int maxConcurrentExecutions)
-
-
Method Details
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription subscription) - Specified by:
onSubscribe
in interfaceorg.reactivestreams.Subscriber<T>
-
onNext
- Specified by:
onNext
in interfaceorg.reactivestreams.Subscriber<T>
-
onError
- Specified by:
onError
in interfaceorg.reactivestreams.Subscriber<T>
-
onComplete
public void onComplete()- Specified by:
onComplete
in interfaceorg.reactivestreams.Subscriber<T>
-
numRequestsInFlight
public int numRequestsInFlight()- Returns:
- the number of requests that are currently in flight
-