Allows to wrap function in another function providing some additional functionality.
Allows to wrap function in another function providing some additional functionality. It may choose to execute or not execute that functionality, but should not interpret or change the returned value; instead, it should perform orthogonal actions that need to occur around the given functionality. Typical example is setting up DB transaction.
This is similar to net.liftweb.common.CommonLoanWrapper, however, it decorates the function eagerly. This way, you can access current thread's state which is essential to do things like set up a HTTP session wrapper
Create an LAFuture from a function that will be applied on a separate thread.
Create an LAFuture from a function that
will be applied on a separate thread. The LAFuture
is returned immediately and the value may be obtained
by calling get
the type
the function that computes the value of the future
an LAFuture that will yield its value when the value has been computed
Build a new future with a call-by-name value that returns a type T
Build a new future with a call-by-name value that returns a type T
the type that
the call-by-name code the defines the future
Collect all the future values into the aggregate future The returned future will be satisfied when all the collected futures are satisfied
Given handlers for a value's success and failure and a set of futures, runs the futures simultaneously and invokes either success or failure callbacks as each future completes.
Given handlers for a value's success and failure and a set of futures, runs
the futures simultaneously and invokes either success or failure callbacks
as each future completes. When all futures are complete, if the handlers
have not either satisfied or failed the overall result, onAllFuturesCompleted
is called to complete it. If it *still* isn't complete, the overall result
is failed with an error.
Note that the success and failure functions are guaranteed to be run in a
thread-safe manner. Each is passed the value, the result future, the
accumulating ArrayBuffer
, and the index of the future that has been
completed. For the failure handler, the value is the Box
of the failure.
Collect all the future values into the aggregate future The returned future will be satisfied when all the collected futures are satisfied or if any of the futures is Empty, then immediately satisfy the returned future with an Empty
Do something when a future is created on this thread.
Do something when a future is created on this thread. This can be used to see if there's any Future activity on a thread and if there is, we can do smart things on an observing thread.
the type of the value returned by toDo
the function to execute on Future creation
the action call-by-name code to execute whi
the value computed by toDo