Method Concurrent.Future()->map()


Method map

this_program map(function(ValueType, __unknown__ ... :mixed) fun, mixed ... extra)

Description

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

Parameter fun

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

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 fun returns a regular value (i.e. not a Future).

See also

map_with(), transform(), recover()