I use Akka in the Play Framework instead of Job to schedule code to run every X seconds. I have a kind of cluster (works on Heroku, currently 1 dino, but sometimes there can be several simultaneous instances).
Is there an easy way to get the βworkβ to execute every N seconds globally across the entire cluster? I know that Quartz supports out-of-process storage / synchronization mechanisms, for example. DB - can I use something like this in Scala?
This is the actorβs installation, launched at the beginning of playback:
object Global extends GlobalSettings { override def onStart(app: Application) { val monitorActor = Akka.system.actorOf(Props[MonitorLoadJob], name = "monitorLoad") Akka.system.scheduler.schedule(0 seconds, 10 seconds, monitorActor, Tick) } }
ripper234
source share