|
@@ -0,0 +1,28 @@
|
|
|
+package org.springblade.common.utils;
|
|
|
+
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
+import org.springframework.context.annotation.Configuration;
|
|
|
+import org.springframework.context.annotation.Primary;
|
|
|
+import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
+
|
|
|
+import java.util.concurrent.*;
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@Configuration
|
|
|
+@EnableAsync
|
|
|
+public class singleEexConfigurerConfig {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 线程池配置
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Bean("singleExecutor")
|
|
|
+ @Primary
|
|
|
+ public ExecutorService getSingleExecutor() {
|
|
|
+ log.info("线程池初始化......");
|
|
|
+ return Executors.newSingleThreadExecutor();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|