Commit Graph

9 Commits

Author SHA1 Message Date
Wesley Wolfe
2750276da3 Add simpler API for using the scheduler. Adds BUKKIT-836
The new methods return the actual task that gets created from the
scheduler. They are also named such that auto-complete puts the
asynchronous methods after the normal ones. These two additions are
simply semantic.

Tasks now have a method to cancel themselves using their task id. This
is provided as a convenience.

A new class called SimpleRunnable was added. It is an abstract Runnable
such that anonymous classes may subclass it. It provides six convenience
methods for scheduling as appropriate. It also provides a cancel method
for convenience. The functionality of SimpleRunnable only stores an
integer representing the task id. A SimpleRunnable can only be scheduled
once; attempting to reschedule results in IllegalStateException.
2012-10-14 02:05:29 -05:00
Erik Broes
eb9dc64493 Generic cleaning 2012-01-15 14:37:43 +01:00
Erik Broes
dce83b6ce4 Generic cleanup of warnings, whitespace and style. 2011-12-25 16:02:30 +01:00
Dinnerbone
e6c273e8b0 Many javadoc fixes thanks to Celtic Minstrel 2011-09-25 02:56:40 +01:00
Raphfrk
e5d04dc923 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
2011-05-02 02:34:59 -04:00
Andrew Ardill
3626a877ce 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.
2011-02-21 12:33:40 +11:00
Andrew Ardill
2157432628 add function isCurrentlyRunning(int taskId);
returns if the given task is currently running.
2011-02-17 13:26:20 +11:00
Raphfrk
0e7b5534b6 Allows calling of functions in the main thread 2011-02-13 22:05:06 -05:00
Raphfrk
83d2d304ba Scheduler 2011-02-07 01:06:20 +01:00