Description
Does it make sense to add $config as a third optional parameter to Utils::all, so that callers have more control over the underlying EachPromise (like concurrency)?
Example
Current code: (this is based on my understanding of Utils::all, unrolled so I can pass $config to EachPromise. If I'm doing this the hard way, this whole request could be moot)
$everything = [];
return (new EachPromise($requestPromises, [
'concurrency' => 5,
'fulfilled' => function ($oneResult) use (&$everything) {
$everything = array_merge($everything, $oneResult);
},
]))
->promise()
->then(function () use (&$everything) {
return $everything;
});
Additional context
I'd be happy to submit a PR for this, I mostly wanted some advice if this is even a good idea, in line with how you want the library to work.
Description Does it make sense to add
$config
as a third optional parameter toUtils::all
, so that callers have more control over the underlying EachPromise (likeconcurrency
)?Example Current code: (this is based on my understanding of Utils::all, unrolled so I can pass
$config
to EachPromise. If I'm doing this the hard way, this whole request could be moot)Desired code:
Additional context I'd be happy to submit a PR for this, I mostly wanted some advice if this is even a good idea, in line with how you want the library to work.