com.coreoz.plume.scheduler.SchedulerProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plume-scheduler Show documentation
Show all versions of plume-scheduler Show documentation
A task scheduler managed by Wisp Scheduler.
package com.coreoz.plume.scheduler;
import javax.inject.Inject;
import javax.inject.Provider;
import javax.inject.Singleton;
import com.coreoz.plume.services.time.TimeProvider;
import com.coreoz.wisp.Scheduler;
import com.coreoz.wisp.SchedulerConfig;
@Singleton
public class SchedulerProvider implements Provider {
private final Scheduler scheduler;
@Inject
public SchedulerProvider(TimeProvider timeProvider) {
this.scheduler = new Scheduler(
SchedulerConfig
.builder()
.timeProvider(new PlumeTimeProvider(timeProvider))
.build()
);
}
@Override
public Scheduler get() {
return scheduler;
}
}