HH\Lib\Keyset\partition_async
Returns a 2-tuple containing keysets for which the given async
predicate returned true
and false
, respectively
namespace HH\Lib\Keyset;
function partition_async<Tv as arraykey>(
Container<Tv> $container,
(function(Tv): Awaitable<bool>) $value_predicate,
): Awaitable<(keyset<Tv>, keyset<Tv>)>;
For non-async predicates, see Keyset\partition()
.
Time complexity: O(n * p), where p is the complexity of synchronous portions
of $value_predicate
Space complexity: O(n)
The IO operations for each of the calls to $value_predicate
will happen
in parallel.
Parameters
Container<Tv>
$container
(function(Tv): Awaitable<bool>) $value_predicate
Returns
Awaitable<(keyset<Tv>,
keyset<Tv>)>