AsyncRenderComet facilitates rendering anything that produces a JsCmd
independently from a page request.
AsyncRenderComet facilitates rendering anything that produces a JsCmd
independently from a page request. All you have to do is create one and
send it a Compute message with the function that will produce the JsCmd.
AsyncRenderComet will take ownership of the function and run it in
a separate thread comet context, sending the results down using a
partialUpdate when it is done.
Note that if you want to run a function that requires the context of the
request you're running in, you'll want to use LiftSession's
buildDeferredFunction method to make sure that when the function is
executed in a separate thread, it will retain request context.
In general, consider using one of:
AsyncRenderComet.asyncRender.
The lazy snippet.
The CanBind implicits in the net.liftweb.http package that allow using
LAFuture and Scala Future objects as the right-hand-side of a CSS
selector binding.
None of these requires explicit use of buildDeferredFunction.
AsyncRenderCometfacilitates rendering anything that produces aJsCmdindependently from a page request. All you have to do is create one and send it aComputemessage with the function that will produce theJsCmd.AsyncRenderCometwill take ownership of the function and run it in a separate thread comet context, sending the results down using apartialUpdatewhen it is done.Note that if you want to run a function that requires the context of the request you're running in, you'll want to use
LiftSession'sbuildDeferredFunctionmethod to make sure that when the function is executed in a separate thread, it will retain request context.In general, consider using one of:
AsyncRenderComet.asyncRender.lazysnippet.CanBindimplicits in thenet.liftweb.httppackage that allow usingLAFutureand ScalaFutureobjects as the right-hand-side of a CSS selector binding.None of these requires explicit use of
buildDeferredFunction.