mbr/elm-again/1.0.1

Again.Decision

Describe whether to retry an action and an optional minimum wait.

= Stop
| Retry
| RetryAfter Float

Describes a decision made to retry an action.

Stop requests no further attempt.

Retry requests another attempt with an unspecified delay.

RetryAfter requests another attempt after at least the given number of milliseconds. The delay must be finite and nonnegative.

fromBool : Bool -> Decision

Converts True to Retry and False to Stop.

Whether the decision requests another attempt.

retryDelay : Decision -> Policy -> Int -> Maybe Float

Calculates the next delay in milliseconds. Count attempts already made, starting at one. Returns Nothing when another attempt is not permitted.