diff options
author | Wolfy-J <[email protected]> | 2018-05-31 15:19:54 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-05-31 15:19:54 +0300 |
commit | 91a081e3ec43302ca1df8d436e48c2a14d7c76b9 (patch) | |
tree | 7c644b8bccf04f1a8dd5c07314665152dbea6d63 /php-src/tests/delay.php | |
parent | 48f4f7a39a2336be24cc74b4116c02cc941dbd9a (diff) |
psr7 support
Diffstat (limited to 'php-src/tests/delay.php')
-rw-r--r-- | php-src/tests/delay.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/php-src/tests/delay.php b/php-src/tests/delay.php new file mode 100644 index 00000000..bfde2fc4 --- /dev/null +++ b/php-src/tests/delay.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 { + usleep($in * 1000); + $rr->send(''); + } catch (\Throwable $e) { + $rr->error((string)$e); + } +}
\ No newline at end of file |