mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 12:12:08 +08:00
enhancement #I3DM92 集成asyncTool作为线程编排的核心
This commit is contained in:
@@ -3,6 +3,7 @@ package com.yomahub.liteflow.asynctool.callback;
|
||||
import com.yomahub.liteflow.asynctool.worker.WorkResult;
|
||||
|
||||
/**
|
||||
* 代码来自于asyncTool,请参考:https://gitee.com/jd-platform-opensource/asyncTool
|
||||
* 默认回调类,如果不设置的话,会默认给这个回调
|
||||
* @author wuweifeng wrote on 2019-11-19.
|
||||
*/
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.yomahub.liteflow.asynctool.wrapper.WorkerWrapper;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代码来自于asyncTool,请参考:https://gitee.com/jd-platform-opensource/asyncTool
|
||||
* @author wuweifeng wrote on 2019-12-27
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.yomahub.liteflow.asynctool.callback;
|
||||
import com.yomahub.liteflow.asynctool.worker.WorkResult;
|
||||
|
||||
/**
|
||||
* 代码来自于asyncTool,请参考:https://gitee.com/jd-platform-opensource/asyncTool
|
||||
* 每个执行单元执行完毕后,会回调该接口</p>
|
||||
* 需要监听执行结果的,实现该接口即可
|
||||
*
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.yomahub.liteflow.asynctool.wrapper.WorkerWrapper;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代码来自于asyncTool,请参考:https://gitee.com/jd-platform-opensource/asyncTool
|
||||
* 如果是异步执行整组的话,可以用这个组回调。不推荐使用
|
||||
* @author wuweifeng wrote on 2019-11-19.
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yomahub.liteflow.asynctool.callback;
|
||||
|
||||
/**
|
||||
* 代码来自于asyncTool,请参考:https://gitee.com/jd-platform-opensource/asyncTool
|
||||
* @author wuweifeng wrote on 2019-12-20
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
@@ -5,8 +5,8 @@ import com.yomahub.liteflow.asynctool.wrapper.WorkerWrapper;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 代码来自于asyncTool,请参考:https://gitee.com/jd-platform-opensource/asyncTool
|
||||
* 每个最小执行单元需要实现该接口
|
||||
*
|
||||
* @author wuweifeng wrote on 2019-11-19.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yomahub.liteflow.asynctool.exception;
|
||||
|
||||
/**
|
||||
* 代码来自于asyncTool,请参考:https://gitee.com/jd-platform-opensource/asyncTool
|
||||
* 如果任务在执行之前,自己后面的任务已经执行完或正在被执行,则抛该exception
|
||||
* @author wuweifeng wrote on 2020-02-18
|
||||
* @version 1.0
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.concurrent.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 代码来自于asyncTool,请参考:https://gitee.com/jd-platform-opensource/asyncTool
|
||||
* 类入口,可以根据自己情况调整core线程的数量
|
||||
* @author wuweifeng wrote on 2019-12-18
|
||||
* @version 1.0
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
/**
|
||||
* 代码来自于asyncTool,请参考:https://gitee.com/jd-platform-opensource/asyncTool
|
||||
* 用于解决高并发下System.currentTimeMillis卡顿
|
||||
* @author lry
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.yomahub.liteflow.asynctool.worker;
|
||||
import com.yomahub.liteflow.asynctool.wrapper.WorkerWrapper;
|
||||
|
||||
/**
|
||||
* 代码来自于asyncTool,请参考:https://gitee.com/jd-platform-opensource/asyncTool
|
||||
* 对依赖的wrapper的封装
|
||||
* @author wuweifeng wrote on 2019-12-20
|
||||
* @version 1.0
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yomahub.liteflow.asynctool.worker;
|
||||
|
||||
/**
|
||||
* 代码来自于asyncTool,请参考:https://gitee.com/jd-platform-opensource/asyncTool
|
||||
* 结果状态
|
||||
* @author wuweifeng wrote on 2019-11-19.
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yomahub.liteflow.asynctool.worker;
|
||||
|
||||
/**
|
||||
* 代码来自于asyncTool,请参考:https://gitee.com/jd-platform-opensource/asyncTool
|
||||
* 执行结果
|
||||
*/
|
||||
public class WorkResult<V> {
|
||||
|
||||
@@ -17,8 +17,8 @@ import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* 代码来自于asyncTool,请参考:https://gitee.com/jd-platform-opensource/asyncTool
|
||||
* 对每个worker及callback进行包装,一对一
|
||||
*
|
||||
* @author wuweifeng wrote on 2019-11-19.
|
||||
*/
|
||||
public class WorkerWrapper<T, V> {
|
||||
|
||||
Reference in New Issue
Block a user