David,

I attempted to follow your blog piece and rewrite the code in
Integrating Flex, BlazeDS, and Scala/Lift, at http://flexonrails.net/?p=103.

Maybe I'm being a bit ambitious to redo this, but when I run just the
Lift portion (without Flex/BazeDS) and make a call to my LiftActor
implementation, nothing happens. Shouldn't the
messageHandler be called automatically (There is nothing to "start",
is there?). It doesn't when I trace through the code. What am I doing
wrong?

Here's my rewrite of Notifier using LiftActor:

class Notifier extends LiftActor{

  val msgBroker = MessageBroker.getMessageBroker(null)
  val clientID = UUIDUtils.createUUID()
  val msg = new AsyncMessage()
  var notificationsSent = 0;

  val currentTime =  new Date().getTime();


  protected def messageHandler = {
    case Notify =>{
      msg.setDestination("notifications")
      msg.setClientId(clientID)
      msg.setTimestamp(currentTime)
      msg.setBody(new Notification(notificationsSent, "Hello from
Scala/Lift", new Date()))
      msgBroker.routeMessageToService(msg,null)
      notificationsSent = 1

     }

     LAPinger.schedule(this, Notify, 500L)

  }
}

case object Notify

class Notification(var id: Int, var message: String, var timesent:
Date){
    def getId = id
    def setId(id: Int) = this.id = id
    def getMessage = message
    def setMessage(m: String) = message = m
    def getTimesent = timesent
    def setTimesent(t: Date) = timesent = t

}


I also have an XMLApiHelper with:

 def dispatch: LiftRules.DispatchPF = {
        case Req("webservices" :: c :: Nil, "", GetRequest)=> () =>
start_feed(c:String)

and start_feed simply calls new Notifiier().

Given this code, the URL: http://localhost:8080/webservices/Notify
successfully calls into
start_feed and creates Notifier but the messageHandler isn't called.

Any help is appreciated?

Thanks,

Glenn

On Oct 22, 10:57 am, David Pollak <[email protected]>
wrote:
> Folks,
>
> I wrote a quick blog piece about migrating from Scala Actors to Lift Actors
> athttp://blog.lostlake.org/index.php?/archives/96-Migrating-from-Scala-...
>
> I hope this addresses questions that folks on the list have about the
> affirmative steps they need to take to make the migration.
>
> Thanks,
>
> David
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890
> Follow me:http://twitter.com/dpp
> Surf the harmonics
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to