Update README.md

This commit is contained in:
Alexander Kiryukhin 2019-03-27 02:47:49 +03:00 committed by GitHub
parent d45d913c9e
commit d4c697cf3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,26 +54,26 @@ Default policy:
#### Example of run policies #### Example of run policies
```go ```go
r.Go(func(ctx context.Context) error { r.Go(func(ctx context.Context) error {
// If this routine produce no error - it just restarts // If this routine produce no error - it just restarts
// If it returns error - all other routines will shutdown (because context cancels) // If it returns error - all other routines will shutdown (because context cancels)
}, rutina.RestartIfDone, rutina.ShutdownIfFail) }, rutina.RestartIfDone, rutina.ShutdownIfFail)
r.Go(func(ctx context.Context) error { r.Go(func(ctx context.Context) error {
// If this routine produce no error - it just completes // If this routine produce no error - it just completes
// If it returns error - all other routines will shutdown (because context cancels) // If it returns error - all other routines will shutdown (because context cancels)
}, rutina.DoNothingIfDone, rutina.ShutdownIfFail) }, rutina.DoNothingIfDone, rutina.ShutdownIfFail)
r.Go(func(ctx context.Context) error { r.Go(func(ctx context.Context) error {
// If this routine produce no error - all other routines will shutdown (because context cancels) // If this routine produce no error - all other routines will shutdown (because context cancels)
// If it returns error - it will be restarted // If it returns error - it will be restarted
}, rutina.RestartIfFail) }, rutina.RestartIfFail)
r.Go(func(ctx context.Context) error { r.Go(func(ctx context.Context) error {
// If this routine stopped by any case - all other routines will shutdown (because context cancels) // If this routine stopped by any case - all other routines will shutdown (because context cancels)
}, rutina.ShutdownIfDone) }, rutina.ShutdownIfDone)
r.ListenOsSignals() // Shutdown all routines by OS signal r.ListenOsSignals() // Shutdown all routines by OS signal
``` ```
### Wait routines to complete ### Wait routines to complete