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 ofSubscriberthat 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 intnumRequestsInFlight()voidonComplete()voidonError(Throwable t)voidonNext(T item)voidonSubscribe(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:
onSubscribein interfaceorg.reactivestreams.Subscriber<T>
-
onNext
public void onNext(T item)
- Specified by:
onNextin interfaceorg.reactivestreams.Subscriber<T>
-
onError
public void onError(Throwable t)
- Specified by:
onErrorin interfaceorg.reactivestreams.Subscriber<T>
-
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
-
-