summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-06-29 23:58:57 +0300
committerWolfy-J <[email protected]>2019-06-29 23:58:57 +0300
commit53ed5e5dc6836ac1d6222fed602204257583a549 (patch)
tree1f637b61cf629bec4dde74ba4ea9b0e1ad5fbd33
parent297031a523070040cf2de63b409135c5098bc393 (diff)
parent216b6a3d3717f9212c94721d1a1b89d3730f419c (diff)
Merge remote-tracking branch 'origin/master'
-rw-r--r--.rr.yaml10
-rw-r--r--README.md22
-rw-r--r--worker.go4
3 files changed, 33 insertions, 3 deletions
diff --git a/.rr.yaml b/.rr.yaml
index 7e38faf7..34ef7af7 100644
--- a/.rr.yaml
+++ b/.rr.yaml
@@ -13,11 +13,21 @@ rpc:
metrics:
# prometheus client address (path /metrics added automatically)
address: localhost:2112
+
+ # list of metrics to collect from application
collect:
+ # metric name
app_metric:
+ # type [gauge, counter, histogram, symnmary]
type: histogram
+
+ # short description
help: "Custom application metric"
+
+ # metric groups/tags
labels: ["type"]
+
+ # for histogram only
buckets: [0.1, 0.2, 0.3, 1.0]
# http service configuration.
diff --git a/README.md b/README.md
index 27be0208..967c11e2 100644
--- a/README.md
+++ b/README.md
@@ -47,11 +47,21 @@ Features:
- integrations with Symfony, Laravel, Slim, CakePHP, Zend Expressive, Spiral
- works on Windows
+Installation:
+--------
+To install:
+
+```
+$ composer require spiral/roadrunner
+$ ./vendor/bin/rr get-binary
+```
+
Example:
--------
```php
<?php
+// worker.php
ini_set('display_errors', 'stderr');
include "vendor/autoload.php";
@@ -75,11 +85,19 @@ Configuration can be located in `.rr.yaml` file ([full sample](https://github.co
```yaml
http:
address: 0.0.0.0:8080
- workers.command: "php psr-worker.php"
+ workers.command: "php worker.php"
```
> Read more in [Wiki](https://github.com/spiral/roadrunner/wiki/PHP-Workers).
+Run:
+----
+To run application server:
+
+```
+$ ./rr serve -v -d
+```
+
License:
--------
-The MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. Maintained by [SpiralScout](https://spiralscout.com).
+The MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. Maintained by [Spiral Scout](https://spiralscout.com).
diff --git a/worker.go b/worker.go
index ac0ba38e..a95a80b3 100644
--- a/worker.go
+++ b/worker.go
@@ -230,7 +230,9 @@ func (w *Worker) execPayload(rqs *Payload) (rsp *Payload, err error) {
return nil, errors.Wrap(err, "header error")
}
- w.rl.Send(rqs.Body, 0)
+ if err = w.rl.Send(rqs.Body, 0); err != nil {
+ return nil, errors.Wrap(err, "sender error")
+ }
var pr goridge.Prefix
rsp = new(Payload)