open fun setTaskExecutor(@Nullable taskExecutor: Executor): Unit
Set a custom executor (typically a org.springframework.core.task.TaskExecutor) to invoke each listener with.
Default is equivalent to org.springframework.core.task.SyncTaskExecutor, executing all listeners synchronously in the calling thread.
Consider specifying an asynchronous task executor here to not block the caller until all listeners have been executed. However, note that asynchronous execution will not participate in the caller's thread context (class loader, transaction association) unless the TaskExecutor explicitly supports this.
See Also
org.springframework.core.task.SyncTaskExecutororg.springframework.core.task.SimpleAsyncTaskExecutor