Improved the Scheduler.
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 By: Raphfrk <raphfrk@gmail.com>
This commit is contained in:
31
paper-api/src/main/java/org/bukkit/scheduler/BukkitTask.java
Normal file
31
paper-api/src/main/java/org/bukkit/scheduler/BukkitTask.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package org.bukkit.scheduler;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
/**
|
||||
* Represents a task being executed by the scheduler
|
||||
*/
|
||||
|
||||
public interface BukkitTask {
|
||||
|
||||
/**
|
||||
* Returns the taskId for the task
|
||||
*
|
||||
* @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 true if the Task is a sync task
|
||||
*
|
||||
* @return true if the task is run by main thread
|
||||
*/
|
||||
public boolean isSync();
|
||||
}
|
||||
Reference in New Issue
Block a user