Pike v8.0 release 1738

Method Concurrent.Future()->recover_with()


Method recover_with

this_program recover_with(function(mixed, mixed ... :this_program) fun, mixed ... extra)

Description

This specifies a callback that is only called on failure, and allows you to alter the future into a success.

Parameter fun

Function to be called. The first argument will be the failure result of this Future. The return value must be a Future that promises the new success result.

Parameter extra

Any extra context needed for fun. They will be provided as arguments two and onwards when the callback is called.

Returns

The new Future.

Note

This method is used if your callbacks return a Future again.

See also

recover(), map_with(), transform_with()