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 TypeMethodDescriptionintvoidvoidvoidvoidonSubscribe(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:
onSubscribein interfaceorg.reactivestreams.Subscriber<T>
-
onNext
-
onError
-
onComplete
public void onComplete()- Specified by:
onCompletein interfaceorg.reactivestreams.Subscriber<T>
-
numRequestsInFlight
public int numRequestsInFlight()- Returns:
- the number of requests that are currently in flight
-