类 ThreadPoolUtils
java.lang.Object
com.sie.mbm.mom.framework.common.util.ThreadPoolUtils
默认线程池操作
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static void通过默认线程池提交一个任务static org.springframework.core.task.AsyncTaskExecutor获取默认线程池static voidinit(org.springframework.core.task.AsyncTaskExecutor asyncTaskExecutor) 初始化线程池static Future<?> 通过默认线程池提交一个任务static CompletableFuture<Void> submitCompletable(Runnable task) 通过默认线程池提交一个任务static <T> CompletableFuture<T> submitCompletable(Callable<T> task) 通过默认线程池提交一个任务static <T,U> CompletableFuture <U> thenComposeAsync(CompletableFuture<T> completableFuture, Function<? super T, ? extends CompletionStage<U>> fn) 连接多个任务
-
字段详细资料
-
ASYNC_TASK_EXECUTOR
private static org.springframework.core.task.AsyncTaskExecutor ASYNC_TASK_EXECUTOR
-
-
构造器详细资料
-
ThreadPoolUtils
public ThreadPoolUtils()
-
-
方法详细资料
-
init
public static void init(org.springframework.core.task.AsyncTaskExecutor asyncTaskExecutor) 初始化线程池 -
getAsyncTaskExecutor
public static org.springframework.core.task.AsyncTaskExecutor getAsyncTaskExecutor()获取默认线程池- 返回:
-
submit
通过默认线程池提交一个任务- 参数:
runnable-- 返回:
-
execute
通过默认线程池提交一个任务- 参数:
runnable-
-
submitCompletable
通过默认线程池提交一个任务- 参数:
task-- 返回:
-
submitCompletable
通过默认线程池提交一个任务- 参数:
task-- 返回:
-
thenComposeAsync
public static <T,U> CompletableFuture<U> thenComposeAsync(CompletableFuture<T> completableFuture, Function<? super T, ? extends CompletionStage<U>> fn) 连接多个任务- 参数:
completableFuture-fn-- 返回:
-