@@ -5,10 +5,10 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | require __DIR__ . '/../vendor/autoload.php'; |
| 7 | 7 | |
| 8 | -Amp\Loop::run(function () { |
|
| 8 | +Amp\Loop::run(function() { |
|
| 9 | 9 | $dispatcher = new Dispatcher(); |
| 10 | 10 | $dispatcher |
| 11 | - ->register('endless', function (string $sign) { |
|
| 11 | + ->register('endless', function(string $sign) { |
|
| 12 | 12 | while (true) { |
| 13 | 13 | yield new Delayed(100); |
| 14 | 14 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | try { |
| 21 | 21 | $action = $dispatcher->dispatch('endless', '.'); |
| 22 | 22 | |
| 23 | - Amp\Loop::delay(500, function () use ($action) { |
|
| 23 | + Amp\Loop::delay(500, function() use ($action) { |
|
| 24 | 24 | $action->cancel(); |
| 25 | 25 | }); |
| 26 | 26 | |
@@ -5,10 +5,10 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | require __DIR__ . '/../vendor/autoload.php'; |
| 7 | 7 | |
| 8 | -Amp\Loop::run(function () { |
|
| 8 | +Amp\Loop::run(function() { |
|
| 9 | 9 | $dispatcher = new Dispatcher(); |
| 10 | 10 | $dispatcher |
| 11 | - ->register('emit', function (string $string, int $num, int $delay = 100) { |
|
| 11 | + ->register('emit', function(string $string, int $num, int $delay = 100) { |
|
| 12 | 12 | for ($i = 0; $i < $num; $i++) { |
| 13 | 13 | echo $string; |
| 14 | 14 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | }) |
| 20 | 20 | ; |
| 21 | 21 | |
| 22 | - $times = \rand(5, 10); |
|
| 22 | + $times = \rand(5, 10); |
|
| 23 | 23 | $actionOne = $dispatcher->dispatch('emit', '-', $times, 100); |
| 24 | 24 | $actionTwo = $dispatcher->dispatch('emit', '+', $times + \rand(5, 10), 100); |
| 25 | 25 | |