Kevin Conaway opened SPR-13407 and commented
Juergen Hoeller what are your thoughts on adding listenable support for the TaskScheduler interface? I'm envisioning an AsyncListenableTaskScheduler interface that has scheduleListenableXXX methods that mirror those in TaskScheduler (similar to AsyncListenableTaskExecutor -> TaskExecutor)
The use case here is to register callbacks that fire for every execution of the scheduled task.
I'm happy to submit a PR for this if you think it would be worthwhile. I have written an implementation for for ListenableScheduledFuture<?> scheduleListenable(Runnable task, Trigger trigger); that we're using here but I would like to get a full featured version in to core if possible
Affects: 4.2 GA
Issue Links: - #19475 Allow ReschedulingRunnable to receive a TriggerContext on creation
Comment From: spring-projects-issues
Kevin Conaway commented
One thing thats important to me is that the callbacks fire after the job is rescheduled again. This allows access to the underlying future so that the callback knows when the job will fire again (for reporting or other use cases)
Comment From: spring-projects-issues
Juergen Hoeller commented
Kevin Conaway, this is still in consideration for 4.3... Could you share your trigger-based implementation for a start?
Juergen
Comment From: jhoeller
This approach got superseded by the deprecation of ListenableFuture
in #27780.