Skip to content

Instantly share code, notes, and snippets.

@eltimn
Forked from tbje/Boot.scala
Created May 7, 2010 14:40
Show Gist options
  • Save eltimn/393497 to your computer and use it in GitHub Desktop.
Save eltimn/393497 to your computer and use it in GitHub Desktop.
Scheduled Tasks via Actor
import net.liftweb.util.ActorPing
import net.liftweb.common.Logger
class Boot extends Logger {
def boot {
// where to search snippet
LiftRules.addToPackages("your.package")
...
val myActor = new MyActor
myActor ! Msg
...
}
}
class MyActor extends LiftActor with Logger {
override def messageHandler = {
case Msg => info("hello")
ActorPing.schedule(this, Msg, 15 minutes)
}
}
case object Msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment