'Catches' exceptions in the given task and returns them as values.
Like run
, but returns exceptions as values.
Calls attempt
and handles some exceptions using the given partial
function.
Calls attempt
and handles some exceptions using the given partial
function. Any nonmatching exceptions are reraised.
Returns a new Task
in which f
is scheduled to be run on completion.
Returns a new Task
in which f
is scheduled to be run on completion.
This would typically be used to release any resources acquired by this
Task
.
Runs this Task
, and if it fails with an exception, runs t2
.
Runs this Task
, and if it fails with an exception, runs t2
.
This is rather coarse-grained. Use attempt
, handle
, and
flatMap
for more fine grained control of exception handling.
Run this Task
and block until its result is available.
Run this Task
and block until its result is available. This will
throw any exceptions generated by the Task
. To return exceptions
in an \/
, use attemptRun
.
Run this computation to obtain either a result or an exception, then invoke the given callback.
Run this computation to obtain either a result or an exception, then
invoke the given callback. Any pure, non-asynchronous computation at the
head of this Future
will be forced in the calling thread. At the first
Async
encountered, control to whatever thread backs the Async
and
this function returns immediately.
Run this computation to obtain an A
, so long as cancel
remains false.
Run this computation to obtain an A
, so long as cancel
remains false.
Because of trampolining, we get frequent opportunities to cancel
while stepping through the trampoline, this should provide a fairly
robust means of cancellation.