You are here

public function FunctionsTest::createLotsOfSynchronousPromise in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/promises/tests/functionsTest.php \GuzzleHttp\Promise\Tests\FunctionsTest::createLotsOfSynchronousPromise()
2 calls to FunctionsTest::createLotsOfSynchronousPromise()
FunctionsTest::testLotsOfSynchronousDoesNotBlowStack in vendor/guzzlehttp/promises/tests/functionsTest.php
FunctionsTest::testLotsOfSynchronousWaitDoesNotBlowStack in vendor/guzzlehttp/promises/tests/functionsTest.php

File

vendor/guzzlehttp/promises/tests/functionsTest.php, line 440

Class

FunctionsTest

Namespace

GuzzleHttp\Promise\Tests

Code

public function createLotsOfSynchronousPromise() {
  return P\coroutine(function () {
    $value = 0;
    for ($i = 0; $i < 1000; $i++) {
      $value = (yield new P\FulfilledPromise($i));
    }
    (yield $value);
  });
}