Add getter and setter for DelayedExecutorService#repeater

This commit is contained in:
Aria 2023-05-24 12:28:36 -07:00
parent 7988bcdf12
commit ef3ecbaa43

View file

@ -31,6 +31,24 @@ public class DelayedExecutorService {
}
private DelayedExecutorService(){}
/**
* Sets the executor to use for this delayed executor service
* @param exec The executor to use
*/
public static void setExecutor(ScheduledThreadPoolExecutor exec)
{
repeater = exec;
}
/**
* Requests the active executor instance
* @return The thread executor
*/
public static ScheduledThreadPoolExecutor getExecutor()
{
return repeater;
}
/**
* This function is designed to set back up the executor if it was previously stopped and restarted.
*/