Crate retry provides utilities for retrying operations that can fail

retry

Crate retry provides utilities for retrying operations that can fail.

Documentation

retry has comprehensive documentation available on docs.rs.

Legal

retry is released under the MIT license. See LICENSE.

Issues

Collection of the latest Issues

IGI-111

IGI-111

1

I just came across this library and I definitely would want to use it but I can't because it doesn't support futures.

I know there are a couple of implementations as PRs already but I'm opening this to push for a decision now that the async ecosystem is probably mature enough.

dtolnay

dtolnay

effort/easy
2

It appears that nothing in this crate ever constructs the Error::Internal variant.

https://github.com/jimmycuadra/retry/blob/faf13cae977c39b817feeb54d9b3787dfc9f72ab/src/lib.rs#L207-L208

It's not clear what its purpose is. If an "error in the internal logic" refers to the possibility of a bug in the logic of retry, the appropriate way to report that is via panic, not an error variant. Panics indicate bugs in the program; errors indicate expected runtime failure modes in a correct program.

srijs

srijs

0

I've been prototyping some ideas on how to provide a tokio middleware for that handles retries. I'd like to get this in for the async release, because it might have consequences on the API design for RetryFuture.

jimmycuadra

jimmycuadra

0

There are a few basic tests right now, but they don't cover all the functionality of the crate, nor do they necessarily really prove that the feature they're supposedly testing does what it's supposed to do.

Versions

Find the latest versions by id

1.3.1 - Feb 02, 2022

Improvements:

1.3.0 - Aug 14, 2021

New features:

  • retry::OperationResult now has predicate methods to check for a specific variant:
    • is_ok
    • is_retry
    • is_err

1.2.1 - Apr 24, 2021

Improvements:

  • Removed async code that is not used. (#36)

Bug fixes:

  • retry::Error now correctly displays the error it wraps when printed. (#35)

1.2.0 - Dec 09, 2020

Improvements:

  • The features of the crate involving randomness are now behind the "random" Cargo feature. This feature is enabled for backwards compatibility, but can now be turned off via Cargo.toml to avoid installing the rand crates if they're not needed.

1.1.0 - Aug 15, 2020

New features:

  • retry::delay::Exponential::from_millis_with_factor is added to support a configurable multiplication factor for exponential delays.

1.0.0 - Jan 12, 2020

retry's API is now stable for the 1.0 series.

New features:

  • Added a retry_with_index function that works like retry, but passes the number of the current try (as u64) as an argument to the supplied closure.

Improvements:

  • retry::delay::{Exponential, Fibonacci} now implement From<std::time::Duration>.
  • retry::delay::Range now implements From<std::ops::Range<std::time::Duration>> and From<std::ops::RangeInclusive<std::time::Duration>>.

0.5.1 - Jun 10, 2019

Improvements:

  • The Fixed delay now implements From<Duration>.

0.5.0 - May 25, 2019

Breaking changes:

  • The library has been significantly redesigned and now offers a simpler and more flexible interface. See the documentation for details.

New features:

  • A new OperationResult type allows for returning an error immediately, halting all retry behavior.
  • Range-based delays can now be constructed with exclusive or inclusive ranges.
  • A fibonacci delay is now provided.
  • A function is now provided to introduce random jitter into a sequence of delays.

v0.4.0 - Apr 02, 2016

Breaking changes:

  • Functions that took u32 values as arguments now take u64 values instead.

New features:

  • A new convenience function, retry_exponentially, is similar to the retry function but uses an f64 wait value as the multiplier for exponential backoff.
  • New methods for the Retry builder type:
    • timeout for setting the maximum amount of time before failure.
    • wait_between for adding some random jitter to the amount of delay between each try.
    • wait_exponentially for waiting exponentially longer with each try.

Improvements:

  • Uses of the deprecated std::thread::sleep_ms have been replaced with std::thread::sleep.

v0.3.0 - Apr 14, 2015

  • Added: Retry type for incrementally building a retryable operation. Currently, this allows for retrying an operation infinitely. Soon it will allow for more customizations of behavior.

v0.2.0 - Apr 14, 2015

  • Changed: The retry function's times argument is now a u32 instead of a usize.

Information - Updated May 13, 2022

Stars: 86
Forks: 20
Issues: 9

Repositories & Extras

Rust library for Self Organising Maps (SOM)

Add rusticsom as a dependency in Cargo

Rust library for Self Organising Maps (SOM)

Rust library for parsing configuration files

The 'option' can be any string with no whitespace

Rust library for parsing configuration files

Rust library for the Pimoroni Four Letter pHAT

This library aims to port ht16k33 (or rather a fork, as of right now) so credit goes to ht16k33-diet

Rust library for the Pimoroni Four Letter pHAT

Rust library for emulating 32-bit RISC-V

This library can execute instructions against any memory and register file that implements

Rust library for emulating 32-bit RISC-V

Rust library for connecting to the IPFS HTTP API using Hyper/Actix

You can use actix-web as a backend instead of hyper

Rust library for connecting to the IPFS HTTP API using Hyper/Actix

Rust library to manipulate file system access control lists (ACL) on macOS, Linux, and FreeBSD

This module provides two high level functions, getfacl and setfacl

Rust library to manipulate file system access control lists (ACL) on macOS, Linux, and FreeBSD

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

This is the place to translate Having a documentation in your native language is essential if you don't speak English, and still enjoyable even if...

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

Rust library for using Infrared hardware decoders (For example a Vishay TSOP* decoder),

enabling remote control support for embedded project

Rust library for using Infrared hardware decoders (For example a Vishay TSOP* decoder),

Rust library for interaction with the OriginTrail Decentralized Knowledge Graph

open up an issue on this repository and let us know

Rust library for interaction with the OriginTrail Decentralized Knowledge Graph

Rust library for parsing COLLADA files

Notice: This library is built around files exported from Blender 2

Rust library for parsing COLLADA files

Rust library for low-level abstraction of MIPS32 processors

This project is licensed under the terms of the MIT license

Rust library for low-level abstraction of MIPS32 processors
Facebook Instagram Twitter GitHub Dribbble
Privacy