aklepatc ([personal profile] aklepatc) wrote2024-04-22 10:34 am
Entry tags:

Exponential Backoff in Golang: take two

Most important change: float multiplier. Special thanks to [personal profile] juan_gandhi for this discussion!

https://github.com/aklepatc/backoff/blob/main/backoff.go
juan_gandhi: (Default)

[personal profile] juan_gandhi 2024-04-22 04:24 pm (UTC)(link)

The code does look weird (to me).

juan_gandhi: (Default)

[personal profile] juan_gandhi 2024-04-22 04:59 pm (UTC)(link)

I don't know go; so this piece looks (to me) just weird:

func expBackoff(
    ctx context.Context,
    call func() error,
    limit int,
    delay time.Duration,
    multiplier float64,
) error {

Just the language.

[personal profile] sassa_nf 2024-04-22 05:14 pm (UTC)(link)
Hmmm... names and types

[personal profile] sassa_nf 2024-04-22 05:51 pm (UTC)(link)
To me - no. I started typing before you responded to juan gandhi, my response doesn't really add value to your explanation.
juan_gandhi: (Default)

[personal profile] juan_gandhi 2024-04-22 05:00 pm (UTC)(link)

Depending on who comments. Since I don't know go, and last time I saw it was about 15 years ago... But I bet some Scala code looks much weirder.

juan_gandhi: (Default)

[personal profile] juan_gandhi 2024-04-22 05:51 pm (UTC)(link)

In this case, I got a feeling that this code structure is very unusual. I'll take a look again tomorrow.

juan_gandhi: (Default)

[personal profile] juan_gandhi 2024-04-22 05:50 pm (UTC)(link)

:) Но гошечку я так и не знаю. Тут вот забрезжил сейчас Unison.

juan_gandhi: (Default)

[personal profile] juan_gandhi 2024-04-22 06:20 pm (UTC)(link)

Они - это Рунар и Пол. Не знаю, там кто-нибудь ещё участвует или нет.

juan_gandhi: (Default)

[personal profile] juan_gandhi 2024-04-22 06:29 pm (UTC)(link)

Runar Bjarnason, Paul Chiusano. Авторы "красной книги" про функциональную Скалу.

juan_gandhi: (Default)

[personal profile] juan_gandhi 2024-04-22 07:04 pm (UTC)(link)

Думаю, у них и денег нет. На свои работать.