File tree Expand file tree Collapse file tree 6 files changed +26
-3
lines changed
java/com/didispace/chapter76
test/java/com/didispace/chapter76 Expand file tree Collapse file tree 6 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 83
83
84
84
### 任务管理
85
85
86
+ ** 定时任务**
87
+
86
88
- [ Spring Boot 2.x基础教程:使用@Scheduled 实现定时任务] ( https://blog.didispace.com/spring-boot-learning-2-7-1 )
87
89
- [ Spring Boot 2.x基础教程:使用Elastic Job实现定时任务] ( https://blog.didispace.com/spring-boot-learning-2-7-2 )
88
90
- [ Spring Boot 2.x基础教程:使用Elastic Job的分片配置提高执行效率] ( https://blog.didispace.com/spring-boot-learning-2-7-3 )
89
91
- [ Spring Boot 2.x基础教程:使用Elastic Job的namespace防止任务名冲突] ( https://blog.didispace.com/spring-boot-learning-2-7-4 )
90
92
93
+ ** 异步任务*
94
+
91
95
- [ Spring Boot 2.x基础教程:使用@Async 实现异步任务] ( https://blog.didispace.com/spring-boot-learning-2-7-5 )
96
+ - [ Spring Boot 2.x基础教程:配置@Async 异步任务的线程池] ( https://blog.didispace.com/spring-boot-learning-2-7-6 )
92
97
93
98
94
99
### 常见问题
Original file line number Diff line number Diff line change 85
85
86
86
### 任务管理
87
87
88
+ ** 定时任务**
89
+
88
90
- [ Spring Boot 2.x基础教程:使用@Scheduled 实现定时任务] ( https://blog.didispace.com/spring-boot-learning-2-7-1 )
89
91
- [ Spring Boot 2.x基础教程:使用Elastic Job实现定时任务] ( https://blog.didispace.com/spring-boot-learning-2-7-2 )
90
92
- [ Spring Boot 2.x基础教程:使用Elastic Job的分片配置提高执行效率] ( https://blog.didispace.com/spring-boot-learning-2-7-3 )
91
93
- [ Spring Boot 2.x基础教程:使用Elastic Job的namespace防止任务名冲突] ( https://blog.didispace.com/spring-boot-learning-2-7-4 )
92
94
95
+ ** 异步任务*
96
+
93
97
- [ Spring Boot 2.x基础教程:使用@Async 实现异步任务] ( https://blog.didispace.com/spring-boot-learning-2-7-5 )
98
+ - [ Spring Boot 2.x基础教程:配置@Async 异步任务的线程池] ( https://blog.didispace.com/spring-boot-learning-2-7-6 )
94
99
95
100
### 常见问题
96
101
Original file line number Diff line number Diff line change 6
6
7
7
import java .util .Random ;
8
8
import java .util .concurrent .CompletableFuture ;
9
+ import java .util .concurrent .Future ;
9
10
10
11
@ Slf4j
11
12
@ Component
Original file line number Diff line number Diff line change
1
+ spring.task.execution.pool.core-size =2
2
+ spring.task.execution.pool.max-size =5
3
+ spring.task.execution.pool.queue-capacity =10
4
+ spring.task.execution.pool.keep-alive =60s
5
+ spring.task.execution.pool.allow-core-thread-timeout =true
6
+ spring.task.execution.thread-name-prefix =task-
7
+
8
+ spring.task.execution.shutdown.await-termination =false
9
+ spring.task.execution.shutdown.await-termination-period =30s
Original file line number Diff line number Diff line change 6
6
import org .springframework .boot .test .context .SpringBootTest ;
7
7
8
8
import java .util .concurrent .CompletableFuture ;
9
- import java .util .concurrent .Future ;
10
9
11
10
@ Slf4j
12
11
@ SpringBootTest
@@ -16,7 +15,7 @@ public class Chapter76ApplicationTests {
16
15
private AsyncTasks asyncTasks ;
17
16
18
17
@ Test
19
- public void test () throws Exception {
18
+ public void test1 () throws Exception {
20
19
long start = System .currentTimeMillis ();
21
20
22
21
CompletableFuture <String > task1 = asyncTasks .doTaskOne ();
Original file line number Diff line number Diff line change 76
76
<module >chapter7-3</module > <!-- 7-3 使用Elastic Job的分片配置 -->
77
77
<module >chapter7-4</module > <!-- 7-4 使用Elastic Job的namespace防止任务名冲突 -->
78
78
<module >chapter7-5</module > <!-- 7-5 使用@Async实现异步任务 -->
79
- <module >chapter7-6</module > <!-- 7-6 @Async异步任务的线程池配置 -->
79
+ <module >chapter7-6</module > <!-- 7-6 配置@Async异步任务的线程池 -->
80
+ <!-- 7-7 @Async异步任务的线程池隔离-->
81
+
82
+ <!-- 安全控制 -->
83
+ <module >chapter8-1</module > <!-- Spring Security快速入门 -->
80
84
81
85
</modules >
82
86
</project >
You can’t perform that action at this time.
0 commit comments