@ -32,13 +32,13 @@ import org.springframework.util.concurrent.ListenableFuture;
@@ -32,13 +32,13 @@ import org.springframework.util.concurrent.ListenableFuture;
import org.springframework.util.concurrent.ListenableFutureTask ;
/ * *
* { @link TaskExecutor } implementation that fires up a new Thread for each task ,
* executing it asynchronously . Provides a virtual thread option on JDK 21 .
* { @link TaskExecutor } implementation that fires up a new Thread for each task .
* Provides a { @link # setVirtualThreads virtual threads } option on JDK 21 + .
*
* < p > Supports a graceful shutdown through { @link # setTaskTerminationTimeout } ,
* at the expense of task tracking overhead per execution thread at runtime .
* Supports limiting concurrent threads through { @link # setConcurrencyLimit } .
* B y default , the number of concurrent task executions is unlimited .
* Supports limiting concurrent threads through { @link # setConcurrencyLimit } ;
* b y default , the number of concurrent task executions is unlimited .
*
* < p > < b > NOTE : This implementation does not reuse threads ! < / b > Consider a
* thread - pooling TaskExecutor implementation instead , in particular for
@ -217,10 +217,11 @@ public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator
@@ -217,10 +217,11 @@ public class SimpleAsyncTaskExecutor extends CustomizableThreadCreator
/ * *
* Specify whether to reject tasks when the concurrency limit has been reached ,
* throwing { @link TaskRejectedException } on any further submiss ion attempts .
* throwing { @link TaskRejectedException } on any further execut ion attempts .
* < p > The default is { @code false } , blocking the caller until the submission can
* be accepted . Switch this to { @code true } for immediate rejection instead .
* @since 6 . 2 . 6
* @see # setConcurrencyLimit
* /
public void setRejectTasksWhenLimitReached ( boolean rejectTasksWhenLimitReached ) {
this . rejectTasksWhenLimitReached = rejectTasksWhenLimitReached ;