Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10429)

Issue 11680043: utils: copy AttemptStrategy from goamz/aws.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by rog
Modified:
10 years, 9 months ago
Reviewers:
mue, gz, mp+176241
Visibility:
Public.

Description

utils: copy AttemptStrategy from goamz/aws. The aws code, originally derived from the juju-core code, allows for some neater ways of writing attempt-based code. In particular it allows us to declare within the loop any variables retrieved during the attempt. for attempt := attempts.Start(); attempt.Next(); { x, err := doSomething() if shouldRetry(err) && attempt.HasNext() { continue } if err != nil { return err } doSomethingWith(x) } https://code.launchpad.net/~rogpeppe/juju-core/346-crossport-attempt/+merge/176241 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : utils: copy AttemptStrategy from goamz/aws. #

Patch Set 3 : utils: copy AttemptStrategy from goamz/aws. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -34 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M utils/attempt.go View 2 chunks +44 lines, -10 lines 0 comments Download
A utils/attempt_test.go View 1 2 1 chunk +87 lines, -0 lines 0 comments Download
M utils/trivial_test.go View 2 chunks +0 lines, -24 lines 0 comments Download

Messages

Total messages: 5
rog
Please take a look.
10 years, 9 months ago (2013-07-22 16:34:46 UTC) #1
mue
LGTM
10 years, 9 months ago (2013-07-23 10:22:15 UTC) #2
gz
LGTM. I'd actually quite like your example usage in the merge proposal as a comment ...
10 years, 9 months ago (2013-07-23 10:26:11 UTC) #3
rog
Please take a look.
10 years, 9 months ago (2013-07-23 11:09:59 UTC) #4
rog
10 years, 9 months ago (2013-07-23 11:10:11 UTC) #5
On 23 July 2013 11:26,  <martin.packman@canonical.com> wrote:
> LGTM. I'd actually quite like your example usage in the merge proposal
> as a comment at the top of the file.

I added it as an example function.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b