# Method Concurrent.Future()->map_with()

Method map_with

  ``this_program` map_with(`function`(`mixed`, `mixed` ... :`this_program`) `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 must be a Future that promises the new 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 `fun` returns a Future again.

See also

  map(), transform_with(), recover_with(), flat_map