HH\Asio\mmkw
Returns an Awaitable
of Map
of ResultOrExceptionWrapper
after a
mapping operation has been applied to each key/value pair in the provided
KeyedTraversable
namespace HH\Asio;
function mmkw<Tk, Tv, Tr>(
KeyedTraversable<Tk, Tv> $inputs,
(function(Tk,Tv):Awaitable<Tr>) $callable,
): Awaitable<Map<Tk, HH\Asio\ResultOrExceptionWrapper<Tr>>>;
This function is similar to mmk()
, except the Map
in the returned
Awaitable
contains values of ResultOrExceptionWrapper
instead of raw
values.
This function is similar to Map::mapWithKey()
, but the mapping of the keys
and values is done using Awaitable
s.
This function is called mmkw
because we are returning a m
ap, doing a
m
apping operation on k
eys and values, and each value member in the Map
is w
rapped by a ResultOrExceptionWrapper
.
$callable
must return an Awaitable
.
The ResultOrExceptionWrapper
s in the Map
of the returned Awaitable
are not available until you await
or join
the returned Awaitable
.
Parameters
KeyedTraversable<Tk, Tv> $inputs
- TheKeyedTraversable
of keys and values to map.(function(Tk,Tv):Awaitable<Tr>) $callable
- The callable containing theAwaitable
operation to apply to$inputs
.
Return Values
Awaitable<Map<Tk, HH\Asio\ResultOrExceptionWrapper<Tr>>>
- AnAwaitable
ofMap
of key/ResultOrExceptionWrapper
pairs after the mapping operation has been applied to the keys an values in$inputs
.