From d4c697cf3a7f1abcdb0b394a84e7df95a4fb03b0 Mon Sep 17 00:00:00 2001 From: Alexander Kiryukhin Date: Wed, 27 Mar 2019 02:47:49 +0300 Subject: Update README.md --- README.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 0ada43f..060d797 100755 --- a/README.md +++ b/README.md @@ -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 -- cgit v1.2.3