Package io.camunda.zeebe.backup.s3.util
Class AsyncAggregatingSubscriber<T>
java.lang.Object
io.camunda.zeebe.backup.s3.util.AsyncAggregatingSubscriber<T>
- All Implemented Interfaces:
org.reactivestreams.Subscriber<CompletableFuture<T>>
public class AsyncAggregatingSubscriber<T>
extends Object
implements org.reactivestreams.Subscriber<CompletableFuture<T>>
Aggregates the results of futures published by a
org.reactivestreams.Publisher<CompletableFuture>.
Once the subscription is started, multiple futures are requested from the publisher. New
futures are requested whenever a future completes. The maximum number of requested futures must
be provided in AsyncAggregatingSubscriber(long parallelism)}
If a futures completes exceptionally, the result is completed exceptionally.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidonNext(CompletableFuture<T> future) voidonSubscribe(org.reactivestreams.Subscription subscription) result()
-
Constructor Details
-
AsyncAggregatingSubscriber
public AsyncAggregatingSubscriber(long parallelism)
-
-
Method Details
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription subscription) - Specified by:
onSubscribein interfaceorg.reactivestreams.Subscriber<T>
-
onNext
- Specified by:
onNextin interfaceorg.reactivestreams.Subscriber<T>
-
onError
- Specified by:
onErrorin interfaceorg.reactivestreams.Subscriber<T>
-
onComplete
public void onComplete()- Specified by:
onCompletein interfaceorg.reactivestreams.Subscriber<T>
-
result
- Returns:
- A future that is completed with the results once all of them have been collected.
-