refactoring

pull/4308/head
Nikita Koksharov 3 years ago
parent 03f0b307a6
commit b237c65f43

@ -594,13 +594,14 @@ public class CommandAsyncService implements CommandAsyncExecutor {
}
CompletableFuture<Void> future = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
CompletableFuture<R> result = future.whenComplete((res, e) -> {
CompletableFuture<R> result = future.thenApply(r -> {
futures.forEach(f -> {
if (!f.isCompletedExceptionally() && f.getNow(null) != null) {
callback.onSlotResult((T) f.getNow(null));
}
});
}).thenApply(r -> callback.onFinish());
return callback.onFinish();
});
return new CompletableFutureWrapper<>(result);
}

Loading…
Cancel
Save