From facf912a7c62485276a8c0b8c8fab068294c871f Mon Sep 17 00:00:00 2001 From: Qingtian Wang Date: Tue, 14 May 2024 20:54:09 -0500 Subject: [PATCH] + rename --- src/main/java/conseq4j/execute/ConseqExecutor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/conseq4j/execute/ConseqExecutor.java b/src/main/java/conseq4j/execute/ConseqExecutor.java index a49bfcf..8835096 100644 --- a/src/main/java/conseq4j/execute/ConseqExecutor.java +++ b/src/main/java/conseq4j/execute/ConseqExecutor.java @@ -142,13 +142,13 @@ private static ConditionFactory await() { public @NonNull Future submit(@NonNull Callable task, @NonNull Object sequenceKey) { CompletableFuture taskCompletable = activeSequentialTasks.compute( sequenceKey, - (k, presentTask) -> (presentTask == null) + (k, vCompletable) -> (vCompletable == null) ? CompletableFuture.supplyAsync(() -> callUnchecked(task), workerExecutorService) - : presentTask.handleAsync((r, e) -> callUnchecked(task), workerExecutorService)); + : vCompletable.handleAsync((r, e) -> callUnchecked(task), workerExecutorService)); CompletableFuture copy = taskCompletable.thenApply(r -> r); taskCompletable.whenCompleteAsync( (r, e) -> activeSequentialTasks.computeIfPresent( - sequenceKey, (k, checkedTask) -> checkedTask.isDone() ? null : checkedTask), + sequenceKey, (k, vCompletable) -> vCompletable.isDone() ? null : vCompletable), adminService); return (Future) new DefensiveFuture<>(copy); }