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:
parent
b5770ba64a
commit
c29da96f3e
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user