diff options
author | Wolfy-J <[email protected]> | 2019-05-03 13:08:49 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2019-05-03 13:08:49 +0300 |
commit | 1e38f34d0d4bca699bd2025dddeb6c66587b3246 (patch) | |
tree | 5fff0a61ca85e35d08623ccb6e8148491d39aa3f /tests | |
parent | 457ec8eac0f5267e61871de87c3f4daa9f595be0 (diff) |
testing watchers
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pid.php | 26 | ||||
-rw-r--r-- | tests/slow-pid.php | 18 |
2 files changed, 31 insertions, 13 deletions
diff --git a/tests/pid.php b/tests/pid.php index a8cfa229..bc1928a6 100644 --- a/tests/pid.php +++ b/tests/pid.php @@ -1,17 +1,17 @@ <?php -/** - * @var Goridge\RelayInterface $relay - */ + /** + * @var Goridge\RelayInterface $relay + */ -use Spiral\Goridge; -use Spiral\RoadRunner; + use Spiral\Goridge; + use Spiral\RoadRunner; -$rr = new RoadRunner\Worker($relay); + $rr = new RoadRunner\Worker($relay); -while ($in = $rr->receive($ctx)) { - try { - $rr->send((string)getmypid()); - } catch (\Throwable $e) { - $rr->error((string)$e); - } -}
\ No newline at end of file + while ($in = $rr->receive($ctx)) { + try { + $rr->send((string)getmypid()); + } catch (\Throwable $e) { + $rr->error((string)$e); + } + }
\ No newline at end of file diff --git a/tests/slow-pid.php b/tests/slow-pid.php new file mode 100644 index 00000000..daaf2583 --- /dev/null +++ b/tests/slow-pid.php @@ -0,0 +1,18 @@ +<?php + /** + * @var Goridge\RelayInterface $relay + */ + + use Spiral\Goridge; + use Spiral\RoadRunner; + + $rr = new RoadRunner\Worker($relay); + + while ($in = $rr->receive($ctx)) { + try { + sleep(1); + $rr->send((string)getmypid()); + } catch (\Throwable $e) { + $rr->error((string)$e); + } + }
\ No newline at end of file |