mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-11-25 18:20:33 -06:00
eagerly await activities in separate thread
This commit is contained in:
parent
f1e3adf518
commit
ad49337599
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user