You are here

private function EachPromise::step in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/guzzlehttp/promises/src/EachPromise.php \GuzzleHttp\Promise\EachPromise::step()
1 call to EachPromise::step()
EachPromise::addPending in vendor/guzzlehttp/promises/src/EachPromise.php

File

vendor/guzzlehttp/promises/src/EachPromise.php, line 176

Class

EachPromise
Represents a promise that iterates over many promises and invokes side-effect functions in the process.

Namespace

GuzzleHttp\Promise

Code

private function step($idx) {

  // If the promise was already resolved, then ignore this step.
  if ($this->aggregate
    ->getState() !== PromiseInterface::PENDING) {
    return;
  }
  unset($this->pending[$idx]);
  $this
    ->advanceIterator();
  if (!$this
    ->checkIfFinished()) {

    // Add more pending promises if possible.
    $this
      ->refillPending();
  }
}