@RestController public class MyController { \t@Autowired \tprivate MyService service; \t \t@GetMapping("/async") \t@Async \tpublic CompletableFuture<String> executeAsync() { \t\treturn service.longRunningMethod(); \t} } @Service public class MyService { \t@Async \tpublic CompletableFuture<String> longRunningMethod() { \t} } spring.task.execution.pool.core-size=10 spring.task.execution.pool.max-size=20


上一篇:
下一篇:
切换中文