From ea34e231188d16eaecb99f37514aa8ac3b75d865 Mon Sep 17 00:00:00 2001 From: Thinh Nguyen Date: Wed, 12 Apr 2017 16:47:40 -0400 Subject: [PATCH] Add Retry option for clients --- client/options.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/options.go b/client/options.go index d75284e6..b7dc9f6a 100644 --- a/client/options.go +++ b/client/options.go @@ -203,6 +203,13 @@ func Retries(i int) Option { } } +// Retry sets the retry function to be used when re-trying. +func Retry(fn RetryFunc) Option { + return func(o *Options) { + o.CallOptions.Retry = fn + } +} + // The request timeout. // Should this be a Call Option? func RequestTimeout(d time.Duration) Option {