TaskScheduler does not work with TaskDecorator #23755
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
TaskDecorator
doesn't directly work with task scheduler implementations -ThreadPoolTaskScheduler
/ConcurrentTaskScheduler
.Related: #18502
I think the underlying reason is there is no easy way of applying
TaskDecorator
toScheduledExecutorService
.Currently, I workaround by wrapping
ScheduledExecutorService
with a proxy that performs task decoration.Proxy Handler:
Wrap created
ScheduledThreadPoolExecutor
inThreadPoolTaskScheduler
:I think it would be nice that
ThreadPoolTaskScheduler
/ConcurrentTaskScheduler
to have some API to work withTaskDecorator
OR a way to easily customize underlyingScheduledExecutorService
to apply decorators.For example, a delegate class that takes
TaskDecorator
:The text was updated successfully, but these errors were encountered: