gpt4 book ai didi

java - java.util.concurrent.ScheduledThreadPoolExecutor 的 Spring 版本

转载 作者:行者123 更新时间:2023-12-04 06:16:14 24 4
gpt4 key购买 nike

我想同时运行一些线程,它们定期执行给定的可运行任务。每个线程都有自己的 Runnable 实例任务。

我发现了 java.util.concurrent.ScheduledThreadPoolExecutor这似乎满足了我的要求。

是否存在提供相同功能的任何 Spring 类?如果是,使用哪个更好。

谢谢

吉腾德拉

最佳答案

http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/scheduling/concurrent/ThreadPoolTaskScheduler.html是我想要的。它是 java.util.concurrent.ScheduledThreadPoolExecutor 的包装器.

关于java - java.util.concurrent.ScheduledThreadPoolExecutor 的 Spring 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7206548/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com