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.
AsyncRenderComet
facilitates rendering anything that produces aJsCmd
independently from a page request. All you have to do is create one and send it aCompute
message with the function that will produce theJsCmd
.AsyncRenderComet
will take ownership of the function and run it in a separate thread comet context, sending the results down using apartialUpdate
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
'sbuildDeferredFunction
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
.lazy
snippet.CanBind
implicits in thenet.liftweb.http
package that allow usingLAFuture
and ScalaFuture
objects as the right-hand-side of a CSS selector binding.None of these requires explicit use of
buildDeferredFunction
.