DeltaExecutor is an async task executor for Spigot servers.
- Uses a thread pool (which means threads are reused instead of recreated for every task)
- Supports a configurable nice shutdown that allows tasks to complete
- Supports task debugging
- Provides more information on a task status
DeltaExecutorexec = DeltaExecutor.instance()Runnabler = ...
longtaskId = DeltaExecutor.instance().execute(r);CancelResultresult = DeltaExecutor.instance().cancel(taskId);
switch(result) {
caseCANCELLED:
// Handle the task being successfully cancelledbreak;
caseRUNNING:
// Handle the task failing to be cancelled due to it being currently runbreak;
caseNOT_FOUND:
// Handle the task not being found (completed task or not existent task)break;
}// It is recommended to call this onDisable() of all plugins that use DeltaExecutor// It is safe to use shutdown() after using shutdown()// The executor falls back to synchronous execution after shutdownDeltaExecutor.instance().shutdown();- Task Metadata
- Callable support
- Repeated async task support
Licence (GPLv3)
DeltaExecutor - Async task executor for Bukkit/Spigot servers.
Copyright (C) 2015 Trace Bachi (tracebachi@gmail.com)
DeltaExecutor is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DeltaExecutor is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeltaExecutor. If not, see <http://www.gnu.org/licenses/>.