From 7d7cb1866c2330cefbd31ed197300819f0605583 Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Thu, 12 Oct 2023 08:57:31 +0200 Subject: [PATCH] Improve internal naming (#791) --- .../collectors/AsyncParallelCollector.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/pivovarit/collectors/AsyncParallelCollector.java b/src/main/java/com/pivovarit/collectors/AsyncParallelCollector.java index e2d4b48a..bb7c44d1 100644 --- a/src/main/java/com/pivovarit/collectors/AsyncParallelCollector.java +++ b/src/main/java/com/pivovarit/collectors/AsyncParallelCollector.java @@ -29,16 +29,16 @@ final class AsyncParallelCollector implements Collector>, CompletableFuture> { private final Dispatcher dispatcher; - private final Function mapper; - private final Function, C> processor; + private final Function task; + private final Function, C> finalizer; private AsyncParallelCollector( - Function mapper, + Function task, Dispatcher dispatcher, - Function, C> processor) { + Function, C> finalizer) { this.dispatcher = dispatcher; - this.processor = processor; - this.mapper = mapper; + this.finalizer = finalizer; + this.task = task; } @Override @@ -55,12 +55,12 @@ public BinaryOperator>> combiner() { @Override public BiConsumer>, T> accumulator() { - return (acc, e) -> acc.add(dispatcher.enqueue(() -> mapper.apply(e))); + return (acc, e) -> acc.add(dispatcher.enqueue(() -> task.apply(e))); } @Override public Function>, CompletableFuture> finisher() { - return futures -> combine(futures).thenApply(processor); + return futures -> combine(futures).thenApply(finalizer); } @Override