Close async tasks properly when shutting down
This commit is contained in:
parent
62ec9c99ef
commit
b47db98420
4 changed files with 83 additions and 23 deletions
|
|
@ -12,12 +12,17 @@ public class BungeeTaskManager extends AbstractTaskManager<ScheduledTask> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void runTask(Runnable runnable) {
|
||||
runTaskAsynchronously(runnable);
|
||||
protected ScheduledTask runTaskImpl(Runnable runnable) {
|
||||
return runTaskAsynchronously(runnable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runTaskAsynchronously(Runnable runnable) {
|
||||
ProxyServer.getInstance().getScheduler().runAsync(ServerUtils.getInstance(), runnable);
|
||||
protected ScheduledTask runTaskAsynchronouslyImpl(Runnable runnable) {
|
||||
return ProxyServer.getInstance().getScheduler().runAsync(ServerUtils.getInstance(), runnable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelTask(ScheduledTask task) {
|
||||
task.cancel();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue