private function FunctionsTest::createLotsOfFlappingPromise in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/promises/tests/functionsTest.php \GuzzleHttp\Promise\Tests\FunctionsTest::createLotsOfFlappingPromise()
2 calls to FunctionsTest::createLotsOfFlappingPromise()
- FunctionsTest::testLotsOfTryCatchingDoesNotBlowStack in vendor/
guzzlehttp/ promises/ tests/ functionsTest.php - FunctionsTest::testLotsOfTryCatchingWaitingDoesNotBlowStack in vendor/
guzzlehttp/ promises/ tests/ functionsTest.php
File
- vendor/
guzzlehttp/ promises/ tests/ functionsTest.php, line 467
Class
Namespace
GuzzleHttp\Promise\TestsCode
private function createLotsOfFlappingPromise() {
return P\coroutine(function () {
$value = 0;
for ($i = 0; $i < 1000; $i++) {
try {
if ($i % 2) {
$value = (yield new P\FulfilledPromise($i));
}
else {
$value = (yield new P\RejectedPromise($i));
}
} catch (\Exception $e) {
$value = (yield new P\FulfilledPromise($i));
}
}
(yield $value);
});
}