Package com.luna.common.thread
Class AsyncEngineUtils
java.lang.Object
com.luna.common.thread.AsyncEngineUtils
- Version:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>concurrentExecute(long timeout, TimeUnit unit, List<Callable<T>> tasks) 并发执行超时控制任务; 如果某任务超时或发生其他异常,则该任务返回值为nullstatic <T> List<T>concurrentExecute(Callable<T>... tasks) 并发执行任务static <T> List<T>concurrentExecute(List<Callable<T>> tasks) 并发执行具有同样返回值的任务static voiddestroy()static void异步执行任务,不需要返回值static void
-
Constructor Details
-
AsyncEngineUtils
public AsyncEngineUtils()
-
-
Method Details
-
concurrentExecute
并发执行任务- Parameters:
tasks- 任务- Returns:
- T 任务返回值
-
concurrentExecute
并发执行具有同样返回值的任务- Parameters:
tasks- 任务- Returns:
- T 任务返回值
-
concurrentExecute
并发执行超时控制任务; 如果某任务超时或发生其他异常,则该任务返回值为null- Parameters:
timeout- 超时时间unit- 超时时间单位tasks- 任务- Returns:
- T 任务返回值
-
execute
异步执行任务,不需要返回值- Parameters:
task-
-
main
-
destroy
public static void destroy()
-