10 Commits

Author SHA1 Message Date
Wesley Wolfe
516bcd8eb7 Deprecate the scheduleAsync methods.
The name is misleading, as it can be misconstrued to mean "a sync"
instead of properly understanding it as "an async"
2012-12-05 13:18:47 -06:00
Wesley Wolfe
c23d7f4e06 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
88c17a7f86 Generic cleaning 2012-01-15 14:37:43 +01:00
Erik Broes
b9fca3c04d Generic cleanup of warnings, whitespace and style. 2011-12-25 16:02:30 +01:00
Dinnerbone
fe4f4c5f58 Many javadoc fixes thanks to Celtic Minstrel 2011-09-25 02:56:40 +01:00
Raphfrk
5c654eeb3d 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
b93f044983 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
e345a982eb add function isCurrentlyRunning(int taskId);
returns if the given task is currently running.
2011-02-17 13:26:20 +11:00
Raphfrk
a4cca21350 Allows calling of functions in the main thread 2011-02-13 22:05:06 -05:00
Raphfrk
2d43dcc125 Scheduler 2011-02-07 01:06:20 +01:00