roger peppe writes:
> There's a fourth way that you haven't mentioned, which fits somewhere
> in between 1 and 2 I think (it was the first explicit general retry
> code in Juju AFAIK), which is utils.Attempt.
>
> I'd suggest that the way it's used matches the pattern
So, in my opinion, juju/retry is pretty good. I think with some tweaking
and some intelligent use, it can feel every bit as lightweight as we'd like.
If we have common use cases, we just need to write up an API to encapsulate
them. If we want a "retry N times or until this channel is closed"
Andrew's queue is certainly nice, but I agree with the points Roger is raising:
1. Go's idiom for coordinating concurrent operations are goroutines and
channels.
2. Sticking to these idioms makes it much easier to compose parts into a whole
(if only because the language strongly bends code that
On Tue, Aug 9, 2016 at 10:17 AM, roger peppe
wrote:
> BTW I'm not saying that a timer queue is never the correct answer. In some
> circumstances, it can be the exactly the right thing to use.
>
Yeah -- the context here is that katco has been looking at the
On 9 August 2016 at 07:28, roger peppe wrote:
> On 9 August 2016 at 01:22, Katherine Cox-Buday
> wrote:
>> Hey All,
>>
>> We currently have 3 ways we're performing retries in Juju:
>>
>> 1. Archaic, custom, intra-package retry code.
On 9 August 2016 at 01:22, Katherine Cox-Buday
wrote:
> Hey All,
>
> We currently have 3 ways we're performing retries in Juju:
>
> 1. Archaic, custom, intra-package retry code.
> 2. github.com/juju/utils::{Countdown,BackoffTimer}
> 3. github.com/juju/retry
On 9 August 2016 at 12:22, Katherine Cox-Buday <
katherine.cox-bu...@canonical.com> wrote:
>
> To implement this, I do something like this:
>
> args := retry.CallArgs{
> Func: func() error {
> // Body of my loop
> },
> BackoffFunc: func(delay time.Duration, attempt int)
Hey All,
We currently have 3 ways we're performing retries in Juju:
1. Archaic, custom, intra-package retry code.
2. github.com/juju/utils::{Countdown,BackoffTimer}
3. github.com/juju/retry (current best practice)
I have just touched some code which fits #1, and when I was attempting to