任务相关
This commit is contained in:
parent
07aeee82d0
commit
a23584f415
|
|
@ -102,6 +102,15 @@ public class Room implements AutoCloseable {
|
||||||
public void stop() {
|
public void stop() {
|
||||||
status.set(false);
|
status.set(false);
|
||||||
cancelTask();
|
cancelTask();
|
||||||
|
futures.forEach((key, value) -> {
|
||||||
|
try {
|
||||||
|
if (!value.isShutdown()) {
|
||||||
|
value.shutdownNow();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("error::", e);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -122,7 +131,6 @@ public class Room implements AutoCloseable {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 启动定时任务
|
// 启动定时任务
|
||||||
private void startTask() {
|
private void startTask() {
|
||||||
if (future == null || future.isCancelled()) {
|
if (future == null || future.isCancelled()) {
|
||||||
|
|
@ -197,8 +205,9 @@ public class Room implements AutoCloseable {
|
||||||
public boolean isRunning() {
|
public boolean isRunning() {
|
||||||
return status.get();
|
return status.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
//统一推送方法
|
//统一推送方法
|
||||||
protected void pushStatus(String resourceId){
|
protected void pushStatus(String resourceId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user