Part of twisted.protocols.htb View Source View In Hierarchy
Token bucket, or something like it.
I can hold up to a certain number of tokens, and I drain over time.Class Variables | maxburst | Size of the bucket, in bytes. If None, the bucket is never full. (type: int ) |
rate | Rate the bucket drains, in bytes per second. If None, the bucket drains instantaneously. (type: int ) |
Parameters | amount | A quanity of tokens to add. (type: int ) |
Returns | The number of tokens that fit. (type: int ) |
Let some of the bucket drain.
How much of the bucket drains depends on how long it has been since I was last called.Returns | True if I am now empty. (type: bool ) |