https://github.com/lift/framework/pull/2002
This takes care of the last executor-service used in Lift.
This way all executor-services used by Lift are configurable in Boot, we use it like this (relevant code only):
Schedule.buildService = () => {
Executors.unconfigurableScheduledExecutorService(
new DataSourceContextAwareScheduledExecutor(1, scheduleServiceThreadFactory)
)
}
Schedule.buildExecutor = () => new DataSourceContextAwareScheduledExecutor(Schedule.threadPoolSize, scheduleExecutorThreadFactory)
Schedule.shutdown()
LAPinger.shutdown
LAPinger.buildService = () => {
Executors.unconfigurableScheduledExecutorService(new DataSourceContextAwareScheduledExecutor(1, actorPingerThreadFactory))
}
LAPinger.restart
LAScheduler.createExecutor = () => {
new ILAExecute with VisenaLoggable {
def execute(f: () => Unit): Unit = {
liftSchedulerExecutor.execute(() => {
try {
f()
} catch {
case t: Throwable => try {
OrigoExceptionHandlerDelegate.handleException(myLogger, t, logApplicationException = true)
} catch {
case t: Throwable =>
myLogger.error(s"liftSchedulerExecutor: Failed handling the Exception in run(): $t", t)
}
}
})
}
def shutdown(): Unit = {}
}
}
LAScheduler.shutdown()
}
liftSchedulerExecutor
is wired up using Spring and injected into Boot.scala
, but one can use any executor-service.