Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. retry

retry

MITGov5.0.0

An advanced interruptible Go library for performing actions repetitively until successful, with context integration and backoff strategies.

Visit WebsiteGitHubGitHub
344 stars14 forks0 contributors

What is retry?

Retry is a Go library that provides an advanced interruptible mechanism to perform actions repetitively until they succeed. It solves the problem of unreliable network communications in distributed systems by offering configurable retry strategies with support for cancellation via Go contexts. The library helps developers handle transient failures gracefully without writing boilerplate retry logic.

Target Audience

Go developers building distributed systems, microservices, or network-dependent applications that require robust fault tolerance and retry capabilities.

Value Proposition

Developers choose Retry for its seamless integration with Go's context package, flexible strategy configuration (including backoff and jitter), and focus on interruptibility, making it more reliable and easier to control than basic retry implementations.

Overview

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

Use Cases

Best For

  • Implementing retry logic in microservices that call external APIs
  • Handling transient network failures in distributed Go applications
  • Adding configurable backoff strategies with jitter to prevent thundering herds
  • Creating interruptible background tasks that respect context timeouts
  • Building CLI tools that need to retry commands until successful
  • Integrating retry mechanisms with circuit breaker patterns for fault tolerance

Not Ideal For

  • Projects requiring simple, non-interruptible retry loops without advanced backoff strategies
  • Applications where strict backward compatibility across library updates is non-negotiable
  • Teams seeking drop-in retry solutions with extensive, ready-to-use documentation and examples
  • Real-time systems with hard latency constraints where any retry delay is unacceptable

Pros & Cons

Pros

Interruptible Execution

Actions can be canceled mid-execution using Go's context package, preventing infinite loops and enabling graceful shutdowns, as demonstrated in the README example with context.WithTimeout.

Flexible Strategy Configuration

Supports configurable limits, backoff algorithms like Fibonacci, and jitter for distributed systems, reducing thundering herd problems through customizable retry behavior.

Native Context Integration

Built to work seamlessly with Go's context package for timeout and cancellation propagation, making it idiomatic for Go applications and enhancing control over retry operations.

Circuit Breaker Compatibility

Designed to integrate with breaker patterns for fault tolerance, as mentioned in the philosophy, though integration requires manual setup with packages like breaker.

Cons

Incomplete Documentation

The 'How to' section is marked as 'rewriting...', indicating gaps or outdated usage guides that can hinder quick adoption and implementation.

Breaking Changes

Major releases are not backward-compatible per SemVer, requiring careful version management and potential code refactoring for upgrades, as noted in the Integration section.

Complex Setup Overhead

Configuring advanced strategies with backoff and jitter involves multiple components and dependencies, adding complexity compared to simpler retry libraries.

Frequently Asked Questions

Quick Stats

Stars344
Forks14
Contributors0
Open Issues9
Last commit2 days ago
CreatedSince 2016

Tags

#retry-logic#hacktoberfest#library#circuit-breaker#distributed-systems#backoff#go-library#backoff-strategies#cli-tool#fault-tolerance#module#retry#repeat#network-communication#context-integration#go#resiliency#awesome-go

Built With

G
Go

Links & Resources

Website

Included in

Go169.1k
Auto-fetched 17 hours ago

Related Projects

fzffzf

:cherry_blossom: A command-line fuzzy finder

Stars81,940
Forks2,820
Last commit1 day ago
divedive

A tool for exploring each layer in a docker image

Stars54,353
Forks1,991
Last commit7 months ago
HubHub

A command-line tool that makes git easier to use with GitHub.

Stars22,957
Forks2,222
Last commit2 years ago
lolo

💥 A Lodash-style Go library based on Go 1.18+ Generics (map, filter, contains, find...)

Stars21,394
Forks946
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub