百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

retry

> 编程语言
开源

♻️ 最先进的可中断机制,可重复执行操作,直到成功为止。

344 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

♻️ 最先进的可中断机制,可重复执行操作,直到成功为止。

♻️ retry Awesome Go

The most advanced interruptible mechanism to perform actions repetitively until successful.

Build Documentation Quality Template Coverage Mirror

Idea

The retry based on Rican7/retry but fully reworked and focused on integration with the breaker and the built-in context package.

go
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.

bash
$ go get github.com/kamilsk/retry/v5@latest

Outcomes

Console tool to execute commands until successful

...

See more details here.

made with ❤️ for everyone

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Goawesome-gobackoffgohacktoberfest

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言