[Lift] Re: how to schedule a job?

2009-09-05 Thread george

Thanks Xavi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: how to schedule a job?

2009-09-05 Thread Xavi Ramirez

I'd use ActorPing also.  Here's a quick example of the code I'd write:

import net.liftweb._
import http._
import util._
import Helpers._

import scala.actors._
import scala.actors.Actor._

case class UpdateUsers()

object UserManager extends Actor {
  this.start
  ActorPing.scheduleAtFixedRate(this, UpdateUsers, 10 minutes, 10 minutes)

  def act = loop {
react {
  case UpdateUsers => //Do something with the DB
}
  }
}

Hope this helps,
Xavi

On Fri, Sep 4, 2009 at 12:47 PM, george wrote:
>
> If I needed to schedule a job say for example to do a database query
> that returned a set of users matching some criteria and send them an
> email. How would I do that in Lift?
>
> I started looking through the API and noticed that we have
> net.liftweb.util.Scheduled in ActorPing.scala is this what I need?
> Anyone have any examples?
>
> thanks..
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---