TaskSchedulerBuilder

Deprecated (for removal)

Since version 3.2.0

Builder that can be used to configure and create a TaskScheduler. Provides convenience methods to set common ThreadPoolTaskScheduler settings. For advanced configuration, consider using TaskSchedulerCustomizer.

In a typical auto-configured Spring Boot application this builder is available as a bean and can be injected whenever a TaskScheduler is needed.

Author

Stephane Nicoll

Since

2.1.0

Deprecated

since 3.2.0 for removal in 3.4.0 in favor of ThreadPoolTaskSchedulerBuilder

Constructors

Link copied to clipboard
constructor()
constructor(poolSize: Integer, awaitTermination: Boolean, awaitTerminationPeriod: Duration, threadNamePrefix: String, taskSchedulerCustomizers: Set<TaskSchedulerCustomizer>)

Functions

Link copied to clipboard
open fun awaitTermination(awaitTermination: Boolean): TaskSchedulerBuilder
Set whether the executor should wait for scheduled tasks to complete on shutdown, not interrupting running tasks and executing all tasks in the queue.
Link copied to clipboard
open fun awaitTerminationPeriod(awaitTerminationPeriod: Duration): TaskSchedulerBuilder
Set the maximum time the executor is supposed to block on shutdown.
Link copied to clipboard
Build a new ThreadPoolTaskScheduler instance and configure it using this builder.
Link copied to clipboard
open fun <T : ThreadPoolTaskScheduler?> configure(taskScheduler: T): T
Configure the provided ThreadPoolTaskScheduler instance using this builder.
Link copied to clipboard
Link copied to clipboard
open fun poolSize(poolSize: Int): TaskSchedulerBuilder
Set the maximum allowed number of threads.
Link copied to clipboard
open fun threadNamePrefix(threadNamePrefix: String): TaskSchedulerBuilder
Set the prefix to use for the names of newly created threads.