Chromium Code Reviews| Index: common/retry/transient.go |
| diff --git a/common/retry/transient.go b/common/retry/transient.go |
| index 157a143e0b3f5aa122b6d6a7b623164261e9bbc0..058c6dad332b34267079933b6a43fea1c36dc70d 100644 |
| --- a/common/retry/transient.go |
| +++ b/common/retry/transient.go |
| @@ -35,3 +35,11 @@ func TransientOnly(i Iterator) Iterator { |
| } |
| return &transientOnlyIterator{i} |
| } |
| + |
| +// TransientOnlyGenerator wraps a retry.Generator, retrying only in the event |
| +// of Transient errors. |
| +func TransientOnlyGenerator(gen Generator) Generator { |
|
dnj (Google)
2016/01/21 04:36:24
Now that we have the concept of a generator, we ca
|
| + return func() Iterator { |
| + return TransientOnly(gen()) |
| + } |
| +} |