org.testng.thread.IWorker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of testng Show documentation
Show all versions of testng Show documentation
Testing framework for Java
package org.testng.thread;
import java.util.List;
/** A runnable object that is used by {@code GraphThreadPoolExecutor} to execute tasks */
public interface IWorker extends Runnable, Comparable> {
/** @return list of tasks this worker is working on. */
List getTasks();
/** @return the maximum time allowed for the worker to complete the task. */
long getTimeOut();
/** @return the priority of this task. */
int getPriority();
default long getCurrentThreadId() {
return -1;
}
default void setThreadIdToRunOn(long threadIdToRunOn) {}
default long getThreadIdToRunOn() {
return -1;
}
default boolean completed() {
return true;
}
}