
上QQ阅读APP看书,第一时间看更新
JobModule
When the application is launched, everything starts with JobModule. It configures the creation of Scheduler, which sends messages to SchedulerActor as given in the application.conf rate:
class JobModule extends AbstractModule with AkkaGuiceSupport {
def configure(): Unit = {
//configuring launch of price-fetching Actor
bindActor[SchedulerActor]("scheduler-actor")
bind(classOf[Scheduler]).asEagerSingleton()
}
}
To enable this module, inside application.conf, the following line is required:
play.modules.enabled += "modules.jobs.JobModule"