summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-15 10:26:45 +0300
committerValery Piashchynski <[email protected]>2020-12-15 10:26:45 +0300
commitcd5a6098b7d671c0fa980f0923f8d6d3733faf68 (patch)
tree4dcb4956d1839c347a5f9e5f4590969ad47861f0 /tests
parent3cf93d96d24201758fb5c23529af90050c3914cb (diff)
Update worker_watcher, psr-worker for gzip moved to the tests
Diffstat (limited to 'tests')
-rw-r--r--tests/psr-worker.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/psr-worker.php b/tests/psr-worker.php
new file mode 100644
index 00000000..b5090d46
--- /dev/null
+++ b/tests/psr-worker.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * @var Goridge\RelayInterface $relay
+ */
+use Spiral\Goridge;
+use Spiral\RoadRunner;
+
+ini_set('display_errors', 'stderr');
+require dirname(__DIR__) . "/vendor/autoload.php";
+
+$worker = new RoadRunner\Worker(new Goridge\StreamRelay(STDIN, STDOUT));
+$psr7 = new RoadRunner\PSR7Client($worker);
+
+while ($req = $psr7->acceptRequest()) {
+ try {
+ $resp = new \Zend\Diactoros\Response();
+ $resp->getBody()->write(str_repeat("hello world", 1000));
+
+ $psr7->respond($resp);
+ } catch (\Throwable $e) {
+ $psr7->getWorker()->error((string)$e);
+ }
+} \ No newline at end of file