aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorcodl <[email protected]>2019-03-11 14:10:44 +0100
committercodl <[email protected]>2019-03-11 14:10:44 +0100
commit1041db3b95db8d9484eefcdb1ab205cfe8aa5a43 (patch)
treef201436acba2210843095a7d496a1fba5ba1a593 /docs
parent8b8626978752baf14347498640b2319db832145e (diff)
downloadmastodon.py-1041db3b95db8d9484eefcdb1ab205cfe8aa5a43.tar.gz
document rate limiting attributes
p sure the thing about editing them was actually wrong since they get updated on every request
Diffstat (limited to 'docs')
-rw-r--r--docs/index.rst25
1 files changed, 22 insertions, 3 deletions
diff --git a/docs/index.rst b/docs/index.rst
index 808e563..515e427 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -71,6 +71,26 @@ for applications that need to handle all rate limiting themselves (i.e. interact
71or applications wanting to use Mastodon.py in a multi-threaded context ("wait" and "pace" 71or applications wanting to use Mastodon.py in a multi-threaded context ("wait" and "pace"
72modes are not thread safe). 72modes are not thread safe).
73 73
74.. note::
75 Rate limit information is available on the `Mastodon` object for applications that
76 implement their own rate limit handling.
77
78 .. attribute:: Mastodon.ratelimit_remaining
79
80 Number of requests allowed until the next reset.
81
82 .. attribute:: Mastodon.ratelimit_reset
83
84 Time at which the rate limit will next be reset, as a POSIX timestamp.
85
86 .. attribute:: Mastodon.ratelimit_limit
87
88 Total number of requests allowed between resets. Typically 300.
89
90 .. attribute:: Mastodon.ratelimit_lastcall
91
92 Time at which these values have last been seen and updated, as a POSIX timestamp.
93
74In "wait" mode, once a request hits the rate limit, Mastodon.py will wait until 94In "wait" mode, once a request hits the rate limit, Mastodon.py will wait until
75the rate limit resets and then try again, until the request succeeds or an error 95the rate limit resets and then try again, until the request succeeds or an error
76is encountered. This mode is for applications that would rather just not worry about rate limits 96is encountered. This mode is for applications that would rather just not worry about rate limits
@@ -91,9 +111,8 @@ minute time slot, and tighter limits on logins. Mastodon.py does not make any ef
91to respect these. 111to respect these.
92 112
93If your application requires many hits to endpoints that are available without logging 113If your application requires many hits to endpoints that are available without logging
94in, do consider using Mastodon.py without authenticating to get the full per-IP limit. In 114in, do consider using Mastodon.py without authenticating to get the full per-IP limit.
95this case, you can set the Mastodon objects `ratelimit_limit` and `ratelimit_remaining` 115
96properties appropriately if you want to use advanced rate limit handling.
97 116
98A note about pagination 117A note about pagination
99----------------------- 118-----------------------
Powered by cgit v1.2.3 (git 2.41.0)