mpyw\Co\Co::promiseAll PHP Метод

promiseAll() приватный Метод

Promise all changes in yieldables are prepared.
private promiseAll ( array $yieldables, boolean $throw_acceptable ) : React\Promise\PromiseInterface
$yieldables array
$throw_acceptable boolean
Результат React\Promise\PromiseInterface
    private function promiseAll(array $yieldables, $throw_acceptable)
    {
        $promises = [];
        foreach ($yieldables as $yieldable) {
            // Add or enqueue cURL handles
            if (TypeUtils::isCurl($yieldable['value'])) {
                $promises[(string) $yieldable['value']] = $this->pool->addCurl($yieldable['value']);
                continue;
            }
            // Process generators
            if (TypeUtils::isGeneratorContainer($yieldable['value'])) {
                $promises[(string) $yieldable['value']] = $this->processGeneratorContainer($yieldable['value']);
                continue;
            }
        }
        // If caller cannot accept exception,
        // we handle rejected value as resolved.
        if (!$throw_acceptable) {
            $promises = array_map(['\\mpyw\\Co\\Internal\\YieldableUtils', 'safePromise'], $promises);
        }
        return \React\Promise\all($promises);
    }