Alphabetize docstring.
This commit is contained in:
parent
c914d4236e
commit
e5114ecf2c
1 changed files with 8 additions and 8 deletions
|
@ -20,14 +20,6 @@ class Ratelimiter:
|
||||||
allowance:
|
allowance:
|
||||||
Our spending balance per `period` seconds.
|
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:
|
mode:
|
||||||
'sleep':
|
'sleep':
|
||||||
If we do not have the balance for an operation, sleep until we
|
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
|
If we do not have the balance for an operation, do nothing and
|
||||||
return False. Otherwise subtract the cost and return True.
|
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
|
Although (allowance=1, period=1) and (allowance=30, period=30) can both
|
||||||
be described as "once per second", the latter allows for much greater
|
be described as "once per second", the latter allows for much greater
|
||||||
burstiness of operation. You could spend the whole allowance in a
|
burstiness of operation. You could spend the whole allowance in a
|
||||||
|
|
Loading…
Reference in a new issue