
com.fathzer.jchess.uci.LongRunningTask Maven / Gradle / Ivy
package com.fathzer.jchess.uci;
import java.util.concurrent.atomic.AtomicBoolean;
/** A task that will be executed in the background of UCI interface.
* @param The result of the task
*/
public abstract class LongRunningTask {
private final AtomicBoolean stopped;
protected LongRunningTask() {
stopped = new AtomicBoolean();
}
public abstract T get();
public boolean isStopped() {
return stopped.get();
}
public void stop() {
stopped.set(true);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy