-
-
Save eltimn/393497 to your computer and use it in GitHub Desktop.
Scheduled Tasks via Actor
This file contains hidden or 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 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