Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to configure client's retry behaviour #123

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,30 @@ e.g., testing or proxy setups.

Either pass the ``api_url`` option to the constructor, or set the ``SEAM_ENDPOINT`` environment variable.

Configuring retry behavior
^^^^^^^^^^^^^^^^^^^^^^^^^^

You can configure the retry behavior of the Seam client by passing a ``urllib3.util.Retry`` object to the constructor.

By default, the Seam client uses urllib3's default retry behavior configuration ``Retry()``.

To set custom retry logic:

.. code-block:: python

from urllib3.util import Retry
from seam import Seam

custom_retries = Retry(
total=5,
backoff_factor=0.2,
status_forcelist=[500, 502, 503, 504, 429]
)

seam = Seam(api_key="your-api-key", retries=custom_retries)

Adjust these parameters based on your specific needs. The client will automatically handle retries for failed requests according to the provided configuration.

Development and Testing
-----------------------

Expand Down