Renamed to FabienHenon/jsonapi-http-retry. It is published under that name, and new versions come out there.
Versions published as calions-app/jsonapi-http-retry still install under that name. 2 versions of 2 come from the new location (see their notes).
Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/FabienHenon/jsonapi-http-retry.
What we checked: The repo moved to github.com/FabienHenon/jsonapi-http-retry. Rebuilt with git archive from commit e6c3bc1260f8 of https://github.com/FabienHenon/jsonapi-http-retry (zip prefix calions-app-jsonapi-http-retry-e6c3bc1/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 13e53041cbea94520506e88de268624f601601f1.
The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.
Details · package.elm-lang.org's zip: https://github.com/calions-app/jsonapi-http-retry/zipball/2.0.0/
Add retries to a jsonapi http task, based on a list of retry policies, until any one of the policies fail too.
A Policy is attached with a function that will return another
Policy as a Task value.
The arguments of the function are
Int timestamp of when we first started originalTask, in millisecondsPolicy x the current policy; destructure to obtain the function to callx last error from attempting originalTask
Refer to maxRetries source code for a simple example.Stop retrying originalTask after a number of retries.
Retry.with [ Retry.maxRetries 20 ] [] originalTask
|> Task.attempt DidOriginalTaskNOTE: The code above does NOT sleep between retries; best to combine with
constantInterval or exponentialBackoff
Stop retrying originalTask after some number of milliseconds.
Retry.with [ Retry.maxDuration 7000 ] [] originalTask
|> Task.attempt DidOriginalTaskNOTE: The code above does NOT sleep between retries; best to combine with
constantInterval or exponentialBackoff
Sleep for the same number of milliseconds before every retry.
Retry.with [ Retry.constantInterval 1000 ] [] originalTask
|> Task.attempt DidOriginalTaskNOTE: The code above will keep retrying originalTask; best to combine with
maxRetries or maxDuration
Sleep for an increasing number of milliseconds before every retry. Backoff algorithim is based off https://github.com/cenkalti/backoff
Retry.with [ Retry.exponentialBackoff { interval = 500, maxInterval = 3000 } ] [] originalTask
|> Task.attempt DidOriginalTaskNOTE: The code above will keep retrying originalTask; best to combine with
maxRetries or maxDuration
FailureCondition contains a function that filter request errors
To use with with function. Filters errors to be retried by retrying errors based on the status code
To use with with function. Filters errors to be retried by retrying errors base on the 401 status code
To use with with function. Filters errors to be retried by retrying errors base on the 403 status code
To use with with function. Filters errors to be retried by retrying all network errors
To use with with function. Filters errors to be retried by retrying all timeout errors
To use with with function. Filters errors to be retried by retrying all errors
Given a list of error handling
Policywe can make ouroriginalTaskretry on failure until any one of thePolicyfails or the request succeeds.