From e5114ecf2ceac871b21d6c3758f10916a6363657 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 9 Jan 2022 16:55:15 -0800 Subject: [PATCH] Alphabetize docstring. --- voussoirkit/ratelimiter.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/voussoirkit/ratelimiter.py b/voussoirkit/ratelimiter.py index ba20da6..6dfa2ed 100644 --- a/voussoirkit/ratelimiter.py +++ b/voussoirkit/ratelimiter.py @@ -20,14 +20,6 @@ class Ratelimiter: allowance: Our spending balance per `period` seconds. - period: - The number of seconds over which we can perform `allowance` - operations. - - operation_cost: - The default amount to remove from our balance after each operation. - Pass a `cost` parameter to `self.limit` to use a nondefault value. - mode: 'sleep': If we do not have the balance for an operation, sleep until we @@ -37,6 +29,14 @@ class Ratelimiter: If we do not have the balance for an operation, do nothing and return False. Otherwise subtract the cost and return True. + operation_cost: + The default amount to remove from our balance after each operation. + Pass a `cost` parameter to `self.limit` to use a nondefault value. + + period: + The number of seconds over which we can perform `allowance` + operations. + Although (allowance=1, period=1) and (allowance=30, period=30) can both be described as "once per second", the latter allows for much greater burstiness of operation. You could spend the whole allowance in a