Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit adb2dff

Browse files
committed
Added note and client construction example that's configured with Replay429Adapter
1 parent c8762ba commit adb2dff

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/getting_started.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ then disconnecting from the server.
2323
Later in the `Context managers`_ section we will see how to
2424
simplify this process through the use of the Python *with* statement.
2525

26+
Note: If you require retrying requests after an HTTP 429 error, the
27+
``Replay429Adapter`` can be added when constructing a ``Cloudant``
28+
client and configured with an initial back off and retry count.
29+
2630
Connecting with a client
2731
^^^^^^^^^^^^^^^^^^^^^^^^
2832

@@ -38,6 +42,10 @@ Connecting with a client
3842
# or using url
3943
# client = Cloudant(USERNAME, PASSWORD, url='https://acct.cloudant.com')
4044
45+
# or with a 429 replay adapter that includes configured retries and initial backoff
46+
# client = Cloudant(USERNAME, PASSWORD, account=ACCOUNT_NAME,
47+
# adapter=Replay429Adapter(retries=10, initialBackoff=0.01))
48+
4149
# Perform client tasks...
4250
session = client.session()
4351
print 'Username: {0}'.format(session['userCtx']['name'])

0 commit comments

Comments
 (0)