[*] 日常优化

This commit is contained in:
acgist
2023-07-20 08:32:14 +08:00
parent 2c2449fd3a
commit eb84cc3d8d
11 changed files with 627 additions and 585 deletions

View File

@@ -1,6 +1,7 @@
package com.acgist.taoyao.boot.utils;
import java.io.Closeable;
import java.nio.channels.AsynchronousChannelGroup;
import lombok.extern.slf4j.Slf4j;
@@ -45,4 +46,19 @@ public final class CloseableUtils {
}
}
/**
* 关闭通道线程池
*
* @param group 通道线程池
*/
public static final void shutdown(AsynchronousChannelGroup group) {
try {
if(group != null) {
group.shutdown();
}
} catch (Exception e) {
log.error("关闭通道线程池异常", e);
}
}
}