@Override
protected void configure() {
// TODO Add instrumentation to ExecutorService and ThreadFactory
final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(SCHEDULED_THREADS_POOL_SIZE,
new ThreadFactoryBuilder()
.setNameFormat("scheduled-%d")
.setDaemon(false)
.setUncaughtExceptionHandler(new Tools.LogUncaughtExceptionHandler(LoggerFactory.getLogger("org.graylog2.scheduler.Scheduler")))
.build()
);
bind(ScheduledExecutorService.class).annotatedWith(Names.named("scheduler")).toInstance(scheduler);
// TODO Add instrumentation to ExecutorService and ThreadFactory
final ScheduledExecutorService daemonScheduler = Executors.newScheduledThreadPool(SCHEDULED_THREADS_POOL_SIZE,
new ThreadFactoryBuilder()
.setNameFormat("scheduled-daemon-%d")
.setDaemon(true)
.setUncaughtExceptionHandler(new Tools.LogUncaughtExceptionHandler(LoggerFactory.getLogger("org.graylog2.scheduler.DaemonScheduler")))
.build()
);