Scheduled Executor in Scala -


in java can use scheduled executor schedule tasks run after given delay. can use in scala wonder if there scala api that.

is there scala api (as opposed scheduled executor in java) schedule tasks?

akka has similar schedulers:

http://doc.akka.io/api/akka/2.1.4/#akka.actor.scheduler

you can obtain 1 actor system:

val actorsystem = actorsystem() val scheduler = actorsystem.scheduler val task = new runnable { def run() { log.info("hello") } } implicit val executor = actorsystem.dispatcher  scheduler.schedule(   initialdelay = duration(5, timeunit.seconds),   interval = duration(10, timeunit.seconds),   runnable = task) 

if using akka or based on it, play, way go.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -