kamilsk/retry
소개
♻️ 작업이 성공할 때까지 반복 실행하는 가장 진보된 중단 가능 메커니즘
기타 프로젝트측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original♻️ retry
The most advanced interruptible mechanism to perform actions repetitively until successful.
💡 Idea
The retry based on Rican7/retry but fully reworked and focused on integration with the 🚧 breaker and the built-in context package.
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
action := func(ctx context.Context) (err error) {
req := req.Clone(ctx)
resp, err = http.DefaultClient.Do(req)
return err
}
how := []retry.How{
strategy.Limit(5),
strategy.BackoffWithJitter(
backoff.Fibonacci(10*time.Millisecond),
jitter.NormalDistribution(
rand.New(rand.NewSource(time.Now().UnixNano())),
0.25,
),
),
}
if err := retry.Do(ctx, action, how...); err != nil {
log.Fatal(err)
}
A full description of the idea is available here.
🏆 Motivation
I developed distributed systems at Lazada, and later at Avito, which communicate with each other through a network, and I need a package to make these communications more reliable.
🤼♂️ How to
rewriting...
🧩 Integration
The library uses SemVer for versioning, and it is not BC-safe through major releases. You can use go modules to manage its version.
$ go get github.com/kamilsk/retry/v5@latest
🤲 Outcomes
Console tool to execute commands until successful
...
See more details here.
made with ❤️ for everyone
관련 프로젝트 살펴보기
불러오는 중…