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 Variable | maxburst | Size of the bucket, in bytes. If None, the bucket is never full. (type: int) |
Class Variable | rate | Rate the bucket drains, in bytes per second. If None, the bucket drains instantaneously. (type: int) |
Method | __init__ | Undocumented |
Method | add | Add tokens to me. |
Method | drip | Let some of the bucket drain. |
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) |