1
0
mirror of https://github.com/danog/amp.git synced 2025-01-22 13:21:16 +01:00

Fix remaining Pause → Delayed in examples and docs

This commit is contained in:
Niklas Keller 2017-05-02 07:25:22 +02:00
parent b5770ba64a
commit c29da96f3e
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ The addition of generators in PHP 5.5 trivializes synchronization and error hand
use Amp\Loop; use Amp\Loop;
function asyncMultiply($x, $y) { function asyncMultiply($x, $y) {
yield new Amp\Pause($millisecondsToPause = 100); yield new Amp\Delayed($millisecondsToPause = 100);
return $x * $y; return $x * $y;
} }

View File

@ -32,7 +32,7 @@ Loop::run(function () {
while (yield $iterator->advance()) { while (yield $iterator->advance()) {
printf("Emitter emitted %d\n", $iterator->getCurrent()); printf("Emitter emitted %d\n", $iterator->getCurrent());
yield new Pause(500); // Listener consumption takes 500 ms. yield new Delayed(500); // Listener consumption takes 500 ms.
} }
} catch (\Exception $exception) { } catch (\Exception $exception) {
printf("Exception: %s\n", $exception); printf("Exception: %s\n", $exception);