diff options
author | Valery Piashchynski <[email protected]> | 2020-12-25 00:55:15 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-12-25 00:55:15 +0300 |
commit | f52156e76cf02e0b3de993fa6d9ba0d2f4e52001 (patch) | |
tree | 025c6c60930844bd10ac776e90266d679e3c1606 /tests/plugins/server/socket.php | |
parent | 1bc3db2ea9b95edd0101676d7bfd75df3782c3bd (diff) |
Initial commit of experiment
Diffstat (limited to 'tests/plugins/server/socket.php')
-rw-r--r-- | tests/plugins/server/socket.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/plugins/server/socket.php b/tests/plugins/server/socket.php new file mode 100644 index 00000000..3159c445 --- /dev/null +++ b/tests/plugins/server/socket.php @@ -0,0 +1,25 @@ +<?php +/** + * @var Goridge\RelayInterface $relay + */ + +use Spiral\Goridge; +use Spiral\RoadRunner; + +require dirname(__DIR__) . "/../vendor/autoload.php"; + +$relay = new Goridge\SocketRelay( + "unix.sock", + null, + Goridge\SocketRelay::SOCK_UNIX + ); + +$rr = new RoadRunner\Worker($relay); + +while ($in = $rr->waitPayload()) { + try { + $rr->send((string)$in->body); + } catch (\Throwable $e) { + $rr->error((string)$e); + } +} |