Liking cljdoc? Tell your friends :D
Clojure only.

stripe-clojure.http.retry


with-retryclj

(with-retry f max-retries)

Creates a retry wrapper for the given function.

Parameters:

  • f: The function to be retried. It should return a map containing a :status key.
  • max-retries: The maximum number of retry attempts.

Returns: A new function that will retry the original function up to max-retries times if it encounters a retryable status code (429 or >= 500).

The returned function will:

  1. Execute the original function.
  2. If the result has a retryable status, it will wait using exponential backoff with jitter.
  3. Retry up to max-retries times.
  4. Return the body of the last attempt, whether successful or not.
Creates a retry wrapper for the given function.

Parameters:
- f: The function to be retried. It should return a map containing a :status key.
- max-retries: The maximum number of retry attempts.

Returns:
A new function that will retry the original function up to max-retries times
if it encounters a retryable status code (429 or >= 500).

The returned function will:
1. Execute the original function.
2. If the result has a retryable status, it will wait using exponential backoff with jitter.
3. Retry up to max-retries times.
4. Return the body of the last attempt, whether successful or not.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close