Simple library for retry mechanism. Context allow to set context of retry default are Background context. Return the direct last error that came from the retried function default is false (return wrapped errors with everything) WithTimer provides a way to swap out timer module implementations. This primarily is useful for mocking/testing, where you may not want to explicitly wait for a set duration for retries. DelayTypeFunc is called to return the next delay to wait after the retriable function fails on err after n attempts. FixedDelay is a DelayType that keeps delay the same through all iterations. DelayTypeFunc accepts a new parameter err - this breaking change affects only your custom Delay Functions. RetryIf controls whether a retry should be attempted after an error (assuming there are any retry attempts remaining).

Features

  • Sightly complicated interface
  • Infinity retry is possible by set Attempts(0) by PR #49
  • BackOffDelay is a DelayType which increases delay between consecutive retries
  • FixedDelay is a DelayType which keeps delay the same through all iterations
  • WrappedErrors returns the list of errors that this Error is wrapping
  • Setting to 0 will retry until the retried function succeeds. default is 10

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow retry

retry Web Site

Other Useful Business Software
Zenflow- The AI Workflow Engine for Software Devs Icon
Zenflow- The AI Workflow Engine for Software Devs

Parallel agents. Multi-agent orchestration. Specs that turn into shipped code. Zenflow automates planning, coding, testing, and verification.

Zenflow is the AI workflow engine built for real teams. Parallel agents plan, code, test, and verify in one workflow. With spec-driven development and deep context, Zenflow turns requirements into production-ready output so teams ship faster and stay in flow.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of retry!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Libraries

Registered

2023-01-31