From 08cbc9b6c05427fd3864bab55a4b40146c54639d Mon Sep 17 00:00:00 2001 From: Alexander Kiryukhin Date: Thu, 4 Apr 2019 11:54:24 +0300 Subject: Changed: - Refactored errors chan Fixed: - Small fixes --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 6d922eb..b3c5ceb 100755 --- a/README.md +++ b/README.md @@ -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 -- cgit v1.2.3