On Thu, Oct 22, 2009 at 4:18 PM, Jonathan Ferguson <j...@spiralarm.com>wrote:
> > > 2009/10/23 David Pollak <feeder.of.the.be...@gmail.com> > >> >> >> On Wed, Oct 21, 2009 at 10:59 PM, Jonathan Ferguson >> <j...@spiralarm.com>wrote: >> >>> >>> >>> 2009/10/22 David Pollak <feeder.of.the.be...@gmail.com> >>> >>>> >>>> >>>> On Wed, Oct 21, 2009 at 8:46 PM, Jonathan Ferguson >>>> <j...@spiralarm.com>wrote: >>>> >>>>> >>>>> I have a StatefulSnippet that uses a CometActor to keep users >>>>> informed when performing a lengthy task, much like the example on the >>>>> demo site ( http://demo.liftweb.net/longtime). >>>>> >>>>> The only difference being I pass the CometActor an identifier so it >>>>> knows which job to inform the user about. >>>>> >>>>> When the task is over I need to display a form to the user, which I >>>>> would assume would be rendered by the snippet. >>>>> >>>>> How does the actor tell the snippet the task is complete ? >>>>> >>>> >>>> The Actor has to know about the snippet... you could send the Actor a >>>> message with a reference to the snippet and then call a method on the >>>> snippet when the Actor is done. Does that do it for you? >>>> >>> >>> >>> I don't see how I can I do that. Currently the comet actor is setup in a >>> snippet, see below, how do get a reference to the actor to send it a >>> message ? >>> >> >> In the snippet that yields this code: >> >> for { >> session <- S.session >> } session.setupComet("WhatDog", Full(id), HeyDudeIMSoStateful(this)) // >> send the HeyDudeIMSoStateful message on setup... this can be anything >> > > Cool, would the correct place to collect the message be in one of the > priority functions ? > exactly right! > For instance ? > > override def lowPriority : PartialFunction[Any, Unit] = { > > case SnippetMessage(wrappedSnippet) => snippet = wrappedSnippet > > > Thanks for the help. > > Jono > > > > > > >> >> >>> >>> <lift:comet type="WatchDog" name={id} > >>> <span id="status"><twd:status>Watch dog status</twd:status></span> >>> </lift:comet> >>> >>> The id being passed via the name parameter is a reference the job to >>> monitor. I mention this only as I'm not sure if it's bad form or not. >>> >>> >>> >>> >>>> >>>> >>>>> >>>>> I assuming it is trivial and I've thought or coded myself into a >>>>> corner. >>>>> >>>>> Thanks in advance. >>>>> >>>>> Jono >>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Lift, the simply functional web framework http://liftweb.net >>>> Beginning Scala http://www.apress.com/book/view/1430219890 >>>> Follow me: http://twitter.com/dpp >>>> Surf the harmonics >>>> >>>> >>>> >>>> >>> >>> >>> >> >> >> -- >> Lift, the simply functional web framework http://liftweb.net >> Beginning Scala http://www.apress.com/book/view/1430219890 >> Follow me: http://twitter.com/dpp >> Surf the harmonics >> >> >> > > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://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 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 -~----------~----~----~----~------~----~------~--~---