Skip to content

Add basic retry policies to zebra-network.#246

Merged
dconnolly merged 1 commit into
mainfrom
retry-policy
Feb 11, 2020
Merged

Add basic retry policies to zebra-network.#246
dconnolly merged 1 commit into
mainfrom
retry-policy

Conversation

@hdevalence
Copy link
Copy Markdown
Contributor

This should be removed when tower-rs/tower#414 lands
but is good enough for our purposes for now.

This should be removed when tower-rs/tower#414 lands
but is good enough for our purposes for now.
@hdevalence
Copy link
Copy Markdown
Contributor Author

Closes #244

Copy link
Copy Markdown
Contributor

@dconnolly dconnolly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


/// A very basic retry policy with a limited number of retry attempts.
///
/// XXX Remove this when https://github.com/tower-rs/tower/pull/414 lands.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


impl<Req: Clone, Res, E> Policy<Req, Res, E> for RetryLimit {
type Future = future::Ready<Self>;
fn retry(&self, _: &Req, result: Result<&Res, &E>) -> Option<Self::Future> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}
}

/// A very basic retry policy that always retries failed requests.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dconnolly dconnolly merged commit abcc0a6 into main Feb 11, 2020
@dconnolly dconnolly deleted the retry-policy branch February 11, 2020 20:23
@dconnolly dconnolly linked an issue Mar 19, 2020 that may be closed by this pull request
skyl added a commit to skyl/zebra that referenced this pull request Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add retry policies to zebra-network.

2 participants