因为无法完全集成,去掉对AsyncTool的依赖,自己依据asyncTool的理念重写了异步线程底层这块

This commit is contained in:
bryan31
2021-11-09 22:16:28 +08:00
parent 105d1fe98f
commit 3da0526c94

View File

@@ -1,29 +0,0 @@
package com.yomahub.liteflow.entity.flow;
import com.yomahub.liteflow.asynctool.callback.IWorker;
import com.yomahub.liteflow.asynctool.wrapper.WorkerWrapper;
import java.util.Map;
public class ParallelWorker implements IWorker<Void, String> {
private final Executable executableItem;
private final Integer slotIndex;
public ParallelWorker(Executable executableItem, Integer slotIndex) {
this.executableItem = executableItem;
this.slotIndex = slotIndex;
}
@Override
public String action(Void object, Map<String, WorkerWrapper> allWrappers) throws Exception{
executableItem.execute(slotIndex);
return executableItem.getExecuteName();
}
@Override
public String defaultValue() {
return executableItem.getExecuteName();
}
}