【Spring】@Async("参数")的参数是什么意思

如题,不知道这个注解里的参数是干什么用的

 public @interface Async {

    /**
     * A qualifier value for the specified asynchronous operation(s).
     * <p>May be used to determine the target executor to be used when executing this
     * method, matching the qualifier value (or the bean name) of a specific
     * {@link java.util.concurrent.Executor Executor} or
     * {@link org.springframework.core.task.TaskExecutor TaskExecutor}
     * bean definition.
     * <p>When specified on a class level {@code @Async} annotation, indicates that the
     * given executor should be used for all methods within the class. Method level use
     * of {@code Async#value} always overrides any value set at the class level.
     * @since 3.1.2
     */
    String value() default "";

}


慕码人2483693
浏览 5441回答 2
2回答

临摹微笑

用于指定使用哪一个线程池执行

互换的青春

642/5000/ * **指定异步操作的限定符值。*可用于确定执行此操作时要使用的目标执行程序方法,匹配特定的限定符值(或bean名称){ @link java . util . concurrent。遗嘱执行人执行人}或{ @link org.springframework.core.task。TaskExecutor TaskExecutor }bean定义。*当在类级别{@code @Async}注释中指定时,表示*给定的executor应该用于类中的所有方法。方法级使用*的{@code async#值}总是覆盖在类级别上设置的任何值。@since 3.1.2/
打开App,查看更多内容
随时随地看视频慕课网APP