diff options
author | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2019-06-29 01:19:21 +0300 |
---|---|---|
committer | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2019-06-29 01:19:21 +0300 |
commit | 01eeeaf5e136928abe75f95d58f3f9cce11c6fe6 (patch) | |
tree | 700f9a5106a51ce1f8b35475c84a7bafac162313 /example/policies.go | |
parent | 741cf397a9150a8f76b8f74289b1dde8aaa43d02 (diff) |
Release.v1.0.0
Auto listen OS signal (with mixin)
Policies: ...Fail -> ...Error
Diffstat (limited to 'example/policies.go')
-rw-r--r-- | example/policies.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/example/policies.go b/example/policies.go index 3e14f5a..6addea7 100644 --- a/example/policies.go +++ b/example/policies.go @@ -21,31 +21,31 @@ func main() { <-time.After(1 * time.Second) log.Println("Do something 1 second without errors and restart") return nil - }, rutina.RestartIfDone, rutina.ShutdownIfFail) + }, rutina.RestartIfDone, rutina.ShutdownIfError) r.Go(func(ctx context.Context) error { <-time.After(2 * time.Second) log.Println("Do something 2 seconds without errors and do nothing") return nil - }, rutina.DoNothingIfDone, rutina.ShutdownIfFail) + }, rutina.DoNothingIfDone, rutina.ShutdownIfError) r.Go(func(ctx context.Context) error { <-time.After(3 * time.Second) log.Println("Do something 3 seconds with error and restart") return errors.New("Error #1!") - }, rutina.RestartIfFail) + }, rutina.RestartIfError) r.Go(func(ctx context.Context) error { <-time.After(4 * time.Second) log.Println("Do something 4 seconds with error and do nothing") return errors.New("Error #2!") - }, rutina.DoNothingIfFail) + }, rutina.DoNothingIfError) r.Go(func(ctx context.Context) error { <-time.After(10 * time.Second) log.Println("Do something 10 seconds with error and close context") return errors.New("Successfully shutdown at proper place") - }, rutina.ShutdownIfFail) + }, rutina.ShutdownIfError) r.Go(func(ctx context.Context) error { for { |