diff options
author | Wolfy-J <[email protected]> | 2018-07-28 16:25:11 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2018-07-28 16:25:11 +0300 |
commit | cc4b4158890addb09094990b9d7bc06c0557a21e (patch) | |
tree | 515cf9882e50ff9442d4a246c1efb54d8423f991 /README.md | |
parent | 575020be597e2f1deda5929396425618356e5a0b (diff) |
Update README.md
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 89 |
1 files changed, 0 insertions, 89 deletions
@@ -35,95 +35,6 @@ Features: - very fast (~250k rpc calls per second on Ryzen 1700X using 16 threads) - works on Windows - -Using RoadRunner: --------- - -In order to use RoadRunner you only have to place a `.rr.yaml` config file in the root of your PHP project: - -```yaml -# defines environment variables for all underlying php processes -env: - key: value - -# rpc bus allows php application and external clients to talk to rr services. -rpc: - # enable rpc server - enable: true - - # rpc connection DSN. Supported TCP and Unix sockets. - listen: tcp://127.0.0.1:6001 - -# http service configuration. -http: - # set to false to disable http server. - enable: true - - # http host to listen. - address: 0.0.0.0:8080 - - # max POST request size, including file uploads in MB. - maxRequest: 200 - - # file upload configuration. - uploads: - # list of file extensions which are forbidden for uploading. - forbid: [".php", ".exe", ".bat"] - - # http worker pool configuration. - workers: - # php worker command. - command: "php psr-worker.php" - - # worker pool configuration. - pool: - # number of workers to be serving. - numWorkers: 4 - - # maximum jobs per worker, 0 - unlimited. - maxJobs: 0 - - # for how long pool should attempt to allocate free worker (request timeout). - allocateTimeout: 60 - - # amount of time given to worker to gracefully destruct itself. - destroyTimeout: 30 - -# static file serving. -static: - # serve http static files - enable: true - - # root directory for static file (http would not serve .php and .htaccess files). - dir: "public" - - # list of extensions to forbid for serving. - forbid: [".php", ".htaccess"] -``` - -> You can use json or any config type supported by `spf13/viper`. - -Where `psr-worker.php`: - -```php -ini_set('display_errors', 'stderr'); -require 'vendor/autoload.php'; - -$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); - } -} -``` - Run `composer require spiral/roadrunner` to load php library. > Check how to init relay [here](./php-src/tests/client.php). |