Adds nag message when async tasks are not properly shut down and adds a limiter for sync tasks. Once they use 35ms in a single tick, any remaining tasks are not executed until later ticks. Adds a method to report the pending tasks and one to report active worker threads
36 lines
744 B
Java
36 lines
744 B
Java
package org.bukkit.scheduler;
|
|
|
|
import org.bukkit.plugin.Plugin;
|
|
|
|
/**
|
|
* Represents a worker thread for the scheduler. This gives information about
|
|
* the Thread object for the task, owner of the task and the taskId.
|
|
*
|
|
* Workers are used to execute async tasks.
|
|
*/
|
|
|
|
public interface BukkitWorker {
|
|
|
|
/**
|
|
* Returns the taskId for the task being executed by this worker
|
|
*
|
|
* @return Task id number
|
|
*/
|
|
public int getTaskId();
|
|
|
|
/**
|
|
* Returns the Plugin that owns this task
|
|
*
|
|
* @return The Plugin that owns the task
|
|
*/
|
|
public Plugin getOwner();
|
|
|
|
/**
|
|
* Returns the thread for the worker
|
|
*
|
|
* @return The Thread object for the worker
|
|
*/
|
|
public Thread getThread();
|
|
|
|
}
|