diff options
author | Alexander Kiryukhin <a.kiryukhin@corp.mail.ru> | 2019-04-04 11:54:24 +0300 |
---|---|---|
committer | Alexander Kiryukhin <a.kiryukhin@corp.mail.ru> | 2019-04-04 11:54:24 +0300 |
commit | 08cbc9b6c05427fd3864bab55a4b40146c54639d (patch) | |
tree | c44ab6f2b976a974c20894b29ee0401b5c073676 /README.md | |
parent | c86dd5f3d70d310a26da73ee4ef2897121c18909 (diff) |
Changed:
- Refactored errors chan
Fixed:
- Small fixes
Diffstat (limited to 'README.md')
-rwxr-xr-x | README.md | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -1,5 +1,7 @@ # rutina +[![GoDoc](https://godoc.org/github.com/neonxp/rutina?status.svg)](https://godoc.org/github.com/neonxp/rutina) + Package Rutina (russian "рутина" - ordinary boring everyday work) is routine orchestrator for your application. It seems like https://godoc.org/golang.org/x/sync/errgroup with some different: @@ -86,6 +88,14 @@ err := r.Wait() Here err = error that shutdowns all routines (may be will be changed at future) +### Get errors channel + +```go +err := <- r.Errors() +``` + +Disabled by default. Use `r.With(rutina.WithErrChan())` to turn on. + ## Mixins ### Usage @@ -119,14 +129,15 @@ r = r.With(rutina.WithContext(ctx context.Context)) Propagates your own context to Rutina. By default it use own context. -### Errors channel +### Enable errors channel ```go -errChan := make(chan error) -r = r.With(rutina.WithErrChan(errChan)) +r = r.With(rutina.WithErrChan()) +... +err := <- r.Errors() ``` -This channel will receive all errors from all routines with any `...Fail` run policy. +Turn on errors channel ## Example |