Part of twisted.protocols.htb View Source View In Hierarchy
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 ) |
How much of the bucket drains depends on how long it has been since I was last called.
Returns | True if the bucket is empty after this drip.
(type: bool
) |