HH\Lib\Dict\map_async
Returns a new dict where each value is the result of calling the given async function on the original value
namespace HH\Lib\Dict;
function map_async<Tk as arraykey, Tv1, Tv2>(
KeyedTraversable<Tk, Tv1> $traversable,
(function(Tv1): Awaitable<Tv2>) $value_func,
): Awaitable<dict<Tk, Tv2>>;
For non-async functions, see Dict\map()
.
Time complexity: O(n * f), where f is the complexity of the synchronous
portions of $async_func
Space complexity: O(n)
The IO operations for each of calls to $async_func
will happen in
parallel.
Parameters
KeyedTraversable<Tk,
Tv1> $traversable
(function(Tv1): Awaitable<Tv2>) $value_func
Returns
Awaitable<dict<Tk,
Tv2>>