Skip to content

Make RetryPolicy aware of request and response #247

@bonsairobo

Description

@bonsairobo

Motivations

Right now, RetryPolicy only knows how many times a request has failed, but it doesn't have any other context about the request+response in question. It would be nice to customize the retry policy based on the value of request and response.

Solution

Add some parameters to RetryPolicy::should_retry, at a minimum:

  • url of the request
  • StatusCode of the response

And then maybe there should be more, but I think these are the most important.

Alternatives

Writing my own retry middleware.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions