Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change jitter implementation #10

Merged
merged 7 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,40 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.2.0] - 2023-??-??

### Changed

- [Breaking] Change backoff and jitter algorithms
- Change the backoff algorithm to a more conventional exponential backoff.
- Replace the decorrelated jitter algorithm with an option of either none, full, or bounded. Defaults to full jitter.
- [Breaking] Remove `ExponentialBackoffBuilder::backoff_exponent()`
- The number of attempts is now used as the exponent.
- [Breaking] Require a task start time when using a total retry duration
- `ExponentialBackoffBuilder::build_with_total_retry_duration()` now returns `ExponentialBackoffTimed` which does not implement `RetryPolicy`.
- [Breaking] Mark `ExponentialBackoff` as `non_exhaustive`
- Can no longer be constructed directly.

## [0.1.2] - 2022-10-28

### Added

- `Debug` derived for `RetryDecision`

## [0.1.1] - 2021-10-18

### Security

- remove time v0.1 dependency

## [0.1.0] - 2021-08-11

### Added

- `ExponentialBackoff` policy.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A collection of plug-and-play retry policies for Rust projects.
Currently available algorithms:

- [`ExponentialBackoff`](https://docs.rs/retry-policies/latest/retry_policies/policies/struct.ExponentialBackoff.html),
with decorrelated jitter.
with configurable jitter.

## How to install

Expand All @@ -19,10 +19,12 @@ Add `retry-policies` to your dependencies
```toml
[dependencies]
# ...
retry-policies = "0.1.2"
retry-policies = "0.2.0"
```

#### License
## License

<!-- markdownlint-disable MD033 -->

<sup>
Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
pub mod policies;
mod retry_policy;

pub use retry_policy::{RetryDecision, RetryPolicy};
pub use retry_policy::{Jitter, RetryDecision, RetryPolicy};
Loading