diff options
author | Wolfy-J <[email protected]> | 2018-07-29 01:03:28 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2018-07-29 01:03:28 +0300 |
commit | efd8d2435e4ac07c5fe4a3726d16a4c58b54b9e2 (patch) | |
tree | 77777e140f925d1e87904286b0875d3ab366d8cb /README.md | |
parent | 8017bee81fa05bbe8c9d2d3f2459a20ad4071215 (diff) |
Update README.md
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -54,6 +54,27 @@ Features: - very fast (~250k rpc calls per second on Ryzen 1700X using 16 threads) - works on Windows +Example: +-------- + +```php +ini_set('display_errors', 'stderr'); + +$relay = new Spiral\Goridge\StreamRelay(STDIN, STDOUT); +$psr7 = new Spiral\RoadRunner\PSR7Client(new Spiral\RoadRunner\Worker($relay)); + +while ($req = $psr7->acceptRequest()) { + try { + $resp = new \Zend\Diactoros\Response() + $resp->getBody()->write("hello world"); + + $psr7->respond($resp); + } catch (\Throwable $e) { + $psr7->getWorker()->error((string)$e); + } +} +``` + License: -------- The MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. Maintained by [SpiralScout](https://spiralscout.com). |