diff options
author | Valery Piashchynski <[email protected]> | 2020-12-15 14:14:32 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-12-15 14:14:32 +0300 |
commit | 323a4f7157b08557d268c7f5cbc23fee2ab03389 (patch) | |
tree | e8cc2745048de52218bb0f8d451d8a10def34cef | |
parent | 091b4f56996d12235f7de6ab1b15ea1ee69d1d7d (diff) |
Update codecov, add psr-bench-worker.php for benches
-rw-r--r-- | codecov.yml | 12 | ||||
-rw-r--r-- | tests/psr-worker-bench.php | 28 |
2 files changed, 38 insertions, 2 deletions
diff --git a/codecov.yml b/codecov.yml index e34b27ea..75e92a5f 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,4 +1,12 @@ coverage: status: - project: on - patch: on
\ No newline at end of file + project: + default: + target: auto + threshold: 0% + informational: true + patch: + default: + target: auto + threshold: 0% + informational: true
\ No newline at end of file diff --git a/tests/psr-worker-bench.php b/tests/psr-worker-bench.php new file mode 100644 index 00000000..e6df81ad --- /dev/null +++ b/tests/psr-worker-bench.php @@ -0,0 +1,28 @@ +<?php +/** + * @var Goridge\RelayInterface $relay + */ +use Spiral\Goridge; +use Spiral\RoadRunner; + +ini_set('display_errors', 'stderr'); +require __DIR__ . "/vendor/autoload.php"; + +$worker = new RoadRunner\Worker(new Goridge\StreamRelay(STDIN, STDOUT)); +$psr7 = new RoadRunner\Http\PSR7Worker( + $worker, + new \Nyholm\Psr7\Factory\Psr17Factory(), + new \Nyholm\Psr7\Factory\Psr17Factory(), + new \Nyholm\Psr7\Factory\Psr17Factory() +); + +while ($req = $psr7->waitRequest()) { + try { + $resp = new \Nyholm\Psr7\Response(); + $resp->getBody()->write("hello world"); + + $psr7->respond($resp); + } catch (\Throwable $e) { + $psr7->getWorker()->error((string)$e); + } +} |