Hi all,
Today Schedule.service is private and initialized like this:
private var service: ScheduledExecutorService = Executors.newSingleThreadScheduledExecutor(TF)
...which is quite unfortunate as it makes it impossible to customize.
I propose we have a "builder", similar to buildExecutor(), so we can provide a custom ExecutorService, with default using the existing, like this:
@volatile var buildService: () => ScheduledExecutorService =
() => Executors.newSingleThreadScheduledExecutor(TF)
private var service: ScheduledExecutorService = buildService()
This way one can provide a custom ExecutorService in Boot.scala, like this:
Schedule.buildService = () => {
Executors.unconfigurableScheduledExecutorService(
new CustomScheduledExecutor(1, myThreadFactory)
)
}
What do you guys think?
--
Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963