eagerly await activities in separate thread

This commit is contained in:
Jonathan Shook 2020-12-07 01:50:30 -06:00
parent f1e3adf518
commit ad49337599

View File

@ -0,0 +1,23 @@
package io.nosqlbench.engine.core.lifecycle;
public class ActivityFinisher extends Thread {
private final ActivityExecutor executor;
private final int timeout;
private boolean result;
public ActivityFinisher(ActivityExecutor executor, int timeout) {
super(executor.getActivityDef().getAlias() + "_finisher");
this.executor = executor;
this.timeout = timeout;
}
@Override
public void run() {
result = executor.awaitCompletion(timeout);
}
public boolean getResult() {
return result;
}
}