summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/pid.php26
-rw-r--r--tests/slow-pid.php18
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