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 ofSubscriber
that execute the provided function for every event and limits the number of concurrent function execution to the givenmaxConcurrentRequests
-
-
Constructor Summary
Constructors Constructor Description AsyncBufferingSubscriber(Function<T,CompletableFuture<?>> consumer, CompletableFuture<Void> returnFuture, int maxConcurrentExecutions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
numRequestsInFlight()
void
onComplete()
void
onError(Throwable t)
void
onNext(T item)
void
onSubscribe(org.reactivestreams.Subscription subscription)
-
-
-
Constructor Detail
-
AsyncBufferingSubscriber
public AsyncBufferingSubscriber(Function<T,CompletableFuture<?>> consumer, CompletableFuture<Void> returnFuture, int maxConcurrentExecutions)
-
-
Method Detail
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription subscription)
- Specified by:
onSubscribe
in interfaceorg.reactivestreams.Subscriber<T>
-
onNext
public void onNext(T item)
- Specified by:
onNext
in interfaceorg.reactivestreams.Subscriber<T>
-
onError
public void onError(Throwable t)
- 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
-
-