|
|
@ -196,4 +196,22 @@ abstract public class DiTaskBase implements DiTask { |
|
|
|
public DiTaskStep getStep() { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
// execute batch actions |
|
|
|
public void batchExecute(List<DiTaskMoveBase.ExecuteCallback> actions) { |
|
|
|
List<Thread> threads = new ArrayList<>(); |
|
|
|
for (DiTaskMoveBase.ExecuteCallback action : actions) { |
|
|
|
Thread thread = new Thread(action::callback); |
|
|
|
threads.add(thread); |
|
|
|
thread.start(); |
|
|
|
} |
|
|
|
|
|
|
|
for (Thread thread : threads) { |
|
|
|
try { |
|
|
|
thread.join(); |
|
|
|
} catch (InterruptedException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |