summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Ardill <andrew.ardill@gmail.com>2011-02-21 12:33:40 +1100
committerAndrew Ardill <andrew.ardill@gmail.com>2011-02-21 12:33:40 +1100
commitb93f04498357187e63c3123e4196dea478403c53 (patch)
treece633caa8c2156efaf61f2c2f8a9d543b1e5d64f /src
parentb2847fdf8c7e217f092c97ef685a170cf2f236e4 (diff)
downloadbukkit-b93f04498357187e63c3123e4196dea478403c53.tar
bukkit-b93f04498357187e63c3123e4196dea478403c53.tar.gz
bukkit-b93f04498357187e63c3123e4196dea478403c53.tar.lz
bukkit-b93f04498357187e63c3123e4196dea478403c53.tar.xz
bukkit-b93f04498357187e63c3123e4196dea478403c53.zip
add isQueued() to allow plugins to know a task is still in the queue.
Currently, there is no way to know if a task is still being handled by the scheduler. This method, along with isCurrentlyRunning() allows a plugin author to determine if a task is waiting to be executed, being executed, or neither.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/scheduler/BukkitScheduler.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java
index 350a5bed..67ec06f7 100644
--- a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java
+++ b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java
@@ -105,17 +105,28 @@ public interface BukkitScheduler {
public void cancelAllTasks();
/**
- * Is the task currently running.
+ * Check if the task currently running.
*
* A repeating task might not be running currently, but will be running in the future.
* A task that has finished, and does not repeat, will not be running ever again.
*
* Explicitly, a task is running if there exists a thread for it, and that thread is alive.
*
- * @param taskId the task to check.
+ * @param taskId The task to check.
*
- * @return if the task is currently running.
+ * @return If the task is currently running.
*/
public boolean isCurrentlyRunning(int taskId);
+ /**
+ * Check if the task queued to be run later.
+ *
+ * If a repeating task is currently running, it might not be queued now but could be in the future.
+ * A task that is not queued, and not running, will not be queued again.
+ *
+ * @param taskId The task to check.
+ *
+ * @return If the task is queued to be run.
+ */
+ public boolean isQueued(int taskId);
}