Created
September 27, 2013 08:39
-
-
Save onilton/6725726 to your computer and use it in GitHub Desktop.
Scheduled task in scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.ActorSystem | |
import scala.concurrent.duration._ | |
val actorSystem = ActorSystem() | |
val scheduler = actorSystem.scheduler | |
val task = new Runnable { def run() { println("Hello") } } | |
implicit val executor = actorSystem.dispatcher | |
scheduler.schedule( | |
initialDelay = 5 seconds, | |
interval = 3 seconds, | |
runnable = task) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment