Document limited concurrency with fixed-delay tasks on virtual threads
Closes gh-31900
This commit is contained in:
parent
a428955438
commit
17d362fa85
|
@ -252,7 +252,9 @@ application server environments, as well -- in particular on Tomcat and Jetty.
|
|||
As of 6.1, `ThreadPoolTaskScheduler` provides a pause/resume capability and graceful
|
||||
shutdown through Spring's lifecycle management. There is also a new option called
|
||||
`SimpleAsyncTaskScheduler` which is aligned with JDK 21's Virtual Threads, using a
|
||||
single scheduler thread but firing up a new thread for every scheduled task execution.
|
||||
single scheduler thread but firing up a new thread for every scheduled task execution
|
||||
(except for fixed-delay tasks which all operate on a single scheduler thread, so for
|
||||
this virtual-thread-aligned option, fixed rates and cron triggers are recommended).
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -131,6 +131,9 @@ public @interface Scheduled {
|
|||
* last invocation and the start of the next.
|
||||
* <p>The time unit is milliseconds by default but can be overridden via
|
||||
* {@link #timeUnit}.
|
||||
* <p><b>NOTE: With virtual threads, fixed rates and cron triggers are recommended
|
||||
* over fixed delays.</b> Fixed-delay tasks operate on a single scheduler thread
|
||||
* with {@link org.springframework.scheduling.concurrent.SimpleAsyncTaskScheduler}.
|
||||
* @return the delay
|
||||
*/
|
||||
long fixedDelay() default -1;
|
||||
|
@ -142,6 +145,9 @@ public @interface Scheduled {
|
|||
* {@link #timeUnit}.
|
||||
* <p>This attribute variant supports Spring-style "${...}" placeholders
|
||||
* as well as SpEL expressions.
|
||||
* <p><b>NOTE: With virtual threads, fixed rates and cron triggers are recommended
|
||||
* over fixed delays.</b> Fixed-delay tasks operate on a single scheduler thread
|
||||
* with {@link org.springframework.scheduling.concurrent.SimpleAsyncTaskScheduler}.
|
||||
* @return the delay as a String value — for example, a placeholder
|
||||
* or a {@link java.time.Duration#parse java.time.Duration} compliant value
|
||||
* @since 3.2.2
|
||||
|
|
Loading…
Reference in New Issue