function EachPromise::step
1 call to EachPromise::step()
- EachPromise::addPending in vendor/
guzzlehttp/ promises/ src/ EachPromise.php
File
-
vendor/
guzzlehttp/ promises/ src/ EachPromise.php, line 219
Class
- EachPromise
- Represents a promise that iterates over many promises and invokes side-effect functions in the process.
Namespace
GuzzleHttp\PromiseCode
private function step(int $idx) : void {
// If the promise was already resolved, then ignore this step.
if (Is::settled($this->aggregate)) {
return;
}
unset($this->pending[$idx]);
// Only refill pending promises if we are not locked, preventing the
// EachPromise to recursively invoke the provided iterator, which
// cause a fatal error: "Cannot resume an already running generator"
if ($this->advanceIterator() && !$this->checkIfFinished()) {
// Add more pending promises if possible.
$this->refillPending();
}
}