Getting started with Async.apex
Then/Catch/Finally
We have corresponding terms for then/catch/finally in Async.apex: then/error/done. Their usages are the same.
promise.then(R.debug)
.error(new ReportFunc())
.done(new CleanupFunc())
.fork();
Important is that differently from promises, Async instances are lazy, which means that we need to fork them to trigger the execution.