Package uk.ac.ebi.utils.opt.runcontrol
Class ReactorUtils
java.lang.Object
uk.ac.ebi.utils.opt.runcontrol.ReactorUtils
Utilities based on the Project Reactor library.
- Author:
- Marco Brandizi
- Date:
- 29 Jun 2024
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ReactorUtils.ParallelBatchFluxBuilder<T,
B extends Collection<T>> Little helper to build a commonParallelFlux
to process a source of items in parallel batches. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> void
batchProcessing
(Collection<T> collection, Consumer<List<T>> task) Variant ofbatchProcessing(Flux, Consumer)
static <T> void
batchProcessing
(Stream<T> stream, Consumer<List<T>> task) Variant ofbatchProcessing(Flux, Consumer)
static <T> void
batchProcessing
(reactor.core.publisher.Flux<T> flux, Consumer<List<T>> task) UsesReactorUtils.ParallelBatchFluxBuilder
with default options andbatchProcessing(ParallelFlux, Consumer)
to batch a source of items and process them in parallel batches.static <T,
B extends Collection<? super T>>
voidbatchProcessing
(reactor.core.publisher.ParallelFlux<B> parallelFlux, Consumer<B> task) UsesReactorUtils.ParallelBatchFluxBuilder
to process a source of batches.static <T> reactor.core.publisher.ParallelFlux<List<T>>
parallelBatchFlux
(Collection<? extends T> collection) Just usesReactorUtils.ParallelBatchFluxBuilder
with its defaults.static <T> reactor.core.publisher.ParallelFlux<List<T>>
parallelBatchFlux
(Stream<? extends T> stream) Just usesReactorUtils.ParallelBatchFluxBuilder
with its defaults.static <T> reactor.core.publisher.ParallelFlux<List<T>>
parallelBatchFlux
(reactor.core.publisher.Flux<? extends T> flux) Just usesReactorUtils.ParallelBatchFluxBuilder
with its defaults.
-
Constructor Details
-
ReactorUtils
public ReactorUtils()
-
-
Method Details
-
parallelBatchFlux
public static <T> reactor.core.publisher.ParallelFlux<List<T>> parallelBatchFlux(reactor.core.publisher.Flux<? extends T> flux) Just usesReactorUtils.ParallelBatchFluxBuilder
with its defaults. -
parallelBatchFlux
public static <T> reactor.core.publisher.ParallelFlux<List<T>> parallelBatchFlux(Stream<? extends T> stream) Just usesReactorUtils.ParallelBatchFluxBuilder
with its defaults. -
parallelBatchFlux
public static <T> reactor.core.publisher.ParallelFlux<List<T>> parallelBatchFlux(Collection<? extends T> collection) Just usesReactorUtils.ParallelBatchFluxBuilder
with its defaults. -
batchProcessing
public static <T,B extends Collection<? super T>> void batchProcessing(reactor.core.publisher.ParallelFlux<B> parallelFlux, Consumer<B> task) UsesReactorUtils.ParallelBatchFluxBuilder
to process a source of batches. -
batchProcessing
UsesReactorUtils.ParallelBatchFluxBuilder
with default options andbatchProcessing(ParallelFlux, Consumer)
to batch a source of items and process them in parallel batches. -
batchProcessing
Variant ofbatchProcessing(Flux, Consumer)
-
batchProcessing
Variant ofbatchProcessing(Flux, Consumer)
-