droplet_kit icon indicating copy to clipboard operation
droplet_kit copied to clipboard

Faraday's retry configuration is not exposed

Open stavxyz opened this issue 5 years ago • 1 comments

Faraday includes a retry middleware module.

At present, droplet_kit does not expose this thus retries are not configurable unless the client's initialize and connection methods are overridden into a new client (as far as I can tell).

An enhancement here would produce an interface something like this

client = DropletKit::Client.new(
  access_token: 'YOUR_TOKEN',
  retry_exceptions: [CustomException, 'Timeout::Error'],
  retry_statuses: [500, 501]
)

# or I think I prefer this:

client = DropletKit::Client.new(
  access_token: 'YOUR_TOKEN',
  retry: {
    exceptions: [CustomException, 'Timeout::Error'],
    statuses: [500, 501]
  }
)

stavxyz avatar Jul 08 '19 19:07 stavxyz

We're planning a thorough overhaul of droplet_kit in the near future. Retries then!

hilary avatar Dec 18 '19 17:12 hilary