diff options
author | Alexander Kiryukhin <alexander@kiryukhin.su> | 2019-03-27 02:47:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-27 02:47:49 +0300 |
commit | d4c697cf3a7f1abcdb0b394a84e7df95a4fb03b0 (patch) | |
tree | 9b758fa1afb95657953b84d94776abe6e19cdb4a /README.md | |
parent | d45d913c9e0d088f339c007f14d2fcaa7b9c8c74 (diff) |
Update README.md
Diffstat (limited to 'README.md')
-rwxr-xr-x | README.md | 40 |
1 files changed, 20 insertions, 20 deletions
@@ -54,26 +54,26 @@ Default policy: #### Example of run policies ```go - r.Go(func(ctx context.Context) error { - // If this routine produce no error - it just restarts - // If it returns error - all other routines will shutdown (because context cancels) - }, rutina.RestartIfDone, rutina.ShutdownIfFail) - - r.Go(func(ctx context.Context) error { - // If this routine produce no error - it just completes - // If it returns error - all other routines will shutdown (because context cancels) - }, rutina.DoNothingIfDone, rutina.ShutdownIfFail) - - r.Go(func(ctx context.Context) error { - // If this routine produce no error - all other routines will shutdown (because context cancels) - // If it returns error - it will be restarted - }, rutina.RestartIfFail) - - r.Go(func(ctx context.Context) error { - // If this routine stopped by any case - all other routines will shutdown (because context cancels) - }, rutina.ShutdownIfDone) - - r.ListenOsSignals() // Shutdown all routines by OS signal +r.Go(func(ctx context.Context) error { + // If this routine produce no error - it just restarts + // If it returns error - all other routines will shutdown (because context cancels) +}, rutina.RestartIfDone, rutina.ShutdownIfFail) + +r.Go(func(ctx context.Context) error { + // If this routine produce no error - it just completes + // If it returns error - all other routines will shutdown (because context cancels) +}, rutina.DoNothingIfDone, rutina.ShutdownIfFail) + +r.Go(func(ctx context.Context) error { + // If this routine produce no error - all other routines will shutdown (because context cancels) + // If it returns error - it will be restarted +}, rutina.RestartIfFail) + +r.Go(func(ctx context.Context) error { + // If this routine stopped by any case - all other routines will shutdown (because context cancels) +}, rutina.ShutdownIfDone) + +r.ListenOsSignals() // Shutdown all routines by OS signal ``` ### Wait routines to complete |