File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
system-design/framework/spring Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -414,6 +414,7 @@ export default sidebar({
414414 "spring-transaction" ,
415415 "spring-design-patterns-summary" ,
416416 "spring-boot-auto-assembly-principles" ,
417+ "async" ,
417418 ] ,
418419 } ,
419420 ] ,
Original file line number Diff line number Diff line change 1+ ---
2+ title : Async 注解原理分析
3+ category : 框架
4+ tag :
5+ - Spring
6+ ---
7+
18# ` @Async ` 原理分析
29
310` @Async ` 注解由 Spring 框架提供,被该注解标注的类或方法会在 ** 异步线程** 中执行。这意味着当方法被调用时,调用者将不会等待该方法执行完成,而是可以继续执行后续的代码。
411
5- ** 原理概述 :** ` @Async ` 可以异步执行任务,本质上是使用 ** 动态代理** 来实现的。通过 Spring 中的后置处理器 ` BeanPostProcessor ` 为使用 ` @Async ` 注解的类创建动态代理,之后 ` @Async ` 注解方法的调用会被动态代理拦截,在拦截器中将方法的执行封装为异步任务提交给线程池处理。
12+ ** 原理介绍 :** ` @Async ` 可以异步执行任务,本质上是使用 ** 动态代理** 来实现的。通过 Spring 中的后置处理器 ` BeanPostProcessor ` 为使用 ` @Async ` 注解的类创建动态代理,之后 ` @Async ` 注解方法的调用会被动态代理拦截,在拦截器中将方法的执行封装为异步任务提交给线程池处理。
613
714开始讲解 ` @Async ` 的原理之前,我们先来看看` @Async ` 使用。
815
You can’t perform that action at this time.
0 commit comments