Skip to content

Commit

Permalink
+ rename
Browse files Browse the repository at this point in the history
  • Loading branch information
q3769 committed May 15, 2024
1 parent eebaf80 commit facf912
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/conseq4j/execute/ConseqExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ private static ConditionFactory await() {
public <T> @NonNull Future<T> submit(@NonNull Callable<T> 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<T>) new DefensiveFuture<>(copy);
}
Expand Down

0 comments on commit facf912

Please sign in to comment.