Package com.alibaba.dashscope.resources
Class AsyncFutures
java.lang.Object
com.alibaba.dashscope.resources.AsyncFutures
Bridges synchronous service methods onto an
Executor for the async resource tree.
Unlike a bare CompletableFuture.supplyAsync(supplier, executor), executor saturation
(the bounded default pool rejecting the task) fails the returned future instead of throwing
RejectedExecutionException synchronously on the caller thread, keeping the async API's
"errors arrive through the future" contract.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> CompletableFuture<T>supplyAsync(Supplier<T> supplier, Executor executor) Runssupplieronexecutor, mirroringCompletableFuture.supplyAsync(supplier, executor)except that executor rejection fails the returned future instead of throwing synchronously.
-
Method Details
-
supplyAsync
Runssupplieronexecutor, mirroringCompletableFuture.supplyAsync(supplier, executor)except that executor rejection fails the returned future instead of throwing synchronously.
-