summaryrefslogtreecommitdiff
path: root/plugins/app/tests/hello.php
blob: 2591b77f160f437e8bc16978b3db965787021b5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
/**
 * @var Goridge\RelayInterface $relay
 */

use Spiral\Goridge;
use Spiral\RoadRunner;

require dirname(__DIR__) . "/../../vendor_php/autoload.php";

$relay = new Goridge\StreamRelay(STDIN, STDOUT);
$rr = new RoadRunner\Worker($relay);

while ($in = $rr->receive($ctx)) {
    try {
        $rr->send((string)$in);
    } catch (\Throwable $e) {
        $rr->error((string)$e);
    }
}