Method Concurrent.Future()->transform_with()


Method transform_with

this_program transform_with(function(ValueType, __unknown__ ... :this_program) success, function(mixed, __unknown__ ... :this_program)|void failure, mixed ... extra)

Description

This specifies callbacks that allow you to alter the future.

Parameter success

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

Parameter failure

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. If this callback is omitted, it will default to the same callback as success.

Parameter extra

Any extra context needed for success and failure. They will be provided as arguments two and onwards when the callbacks are called.

Returns

The new Future.

Note

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

See also

transform(), map_with(), recover_with