public class AsyncUtil extends Object
Constructor and Description |
---|
AsyncUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
allOfGet(CompletableFuture<T>... tasks)
获取所有任务的返回值,重载方法
|
static <T> List<T> |
allOfGet(CompletableFuture<T>[] tasks,
Function<Exception,T> eHandler)
获取所有任务的返回值,可以为异常任务添加异常处理方法
|
static <T> List<T> |
allOfGet(List<CompletableFuture<T>> tasks)
获取所有任务的返回值
|
static <T> List<T> |
allOfGet(List<CompletableFuture<T>> tasks,
Function<Exception,T> eHandler)
获取所有任务的返回值,可以为异常任务添加异常处理方法,重载方法
|
static <T> T |
get(CompletableFuture<T> task)
获取异步任务结果,包裹了异常
|
static <T> List<T> |
parallelAllOfGet(CompletableFuture<T>... tasks)
获取所有任务的返回值,并行执行,重载方法
|
static <T> List<T> |
parallelAllOfGet(CompletableFuture<T>[] tasks,
Function<Exception,T> eHandler)
获取所有任务的返回值,并行执行,可以为异常任务添加异常处理方法
|
static <T> List<T> |
parallelAllOfGet(List<CompletableFuture<T>> tasks)
获取所有任务的返回值,并行执行
|
static <T> List<T> |
parallelAllOfGet(List<CompletableFuture<T>> tasks,
Function<Exception,T> eHandler)
获取所有任务的返回值,并行执行,可以为异常任务添加异常处理方法,重载方法
|
static void |
waitAll(CompletableFuture<?>... tasks)
等待所有任务执行完毕,包裹了异常
|
static <T> T |
waitAny(CompletableFuture<?>... tasks)
等待任意一个任务执行完毕,包裹了异常
|
public static void waitAll(CompletableFuture<?>... tasks)
tasks
- 并行任务UndeclaredThrowableException
- 未受检异常public static <T> T waitAny(CompletableFuture<?>... tasks)
T
- 任务返回值类型tasks
- 并行任务UndeclaredThrowableException
- 未受检异常public static <T> T get(CompletableFuture<T> task)
T
- 任务返回值类型task
- 异步任务RuntimeException
- 未受检异常public static <T> List<T> allOfGet(List<CompletableFuture<T>> tasks)
T
- 任务返回值类型tasks
- 任务集合@SafeVarargs public static <T> List<T> allOfGet(CompletableFuture<T>... tasks)
T
- 任务返回值类型tasks
- 任务集合public static <T> List<T> allOfGet(CompletableFuture<T>[] tasks, Function<Exception,T> eHandler)
T
- 任务内返回值的类型tasks
- 任务集合eHandler
- 异常处理方法public static <T> List<T> allOfGet(List<CompletableFuture<T>> tasks, Function<Exception,T> eHandler)
T
- 任务返回值类型tasks
- 任务集合eHandler
- 异常处理方法@SafeVarargs public static <T> List<T> parallelAllOfGet(CompletableFuture<T>... tasks)
T
- 任务返回值类型tasks
- 任务集合public static <T> List<T> parallelAllOfGet(List<CompletableFuture<T>> tasks)
T
- 任务返回值类型tasks
- 任务集合public static <T> List<T> parallelAllOfGet(CompletableFuture<T>[] tasks, Function<Exception,T> eHandler)
T
- 任务返回值类型tasks
- 任务集合eHandler
- 异常处理方法public static <T> List<T> parallelAllOfGet(List<CompletableFuture<T>> tasks, Function<Exception,T> eHandler)
T
- 任务返回值类型tasks
- 任务集合eHandler
- 异常处理方法Copyright © 2025. All rights reserved.