Package twisted :: Package protocols :: Module htb :: Class Bucket |
[show private | hide private]
[frames | no frames]

## Class Bucket

Token bucket, or something like it.

I can hold up to a certain number of tokens, and I drain over time.

Method Summary
| `__init__(self, parentBucket)`
int | ``add`(self, amount)` Add tokens to me.
bool | ``drip`(self)` Let some of the bucket drain.

Class Variable Summary
int | `maxburst` - Size of the bucket, in bytes.
int | `rate` - Rate the bucket drains, in bytes per second.
`int` | `_refcount`

Method Details

### add(self, amount) Add tokens to me. Parameters: `amount` - A quanity of tokens to add. (type=int) Returns: The number of tokens that fit. (type=int)

### drip(self) 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)

Class Variable Details

    ### maxburst Size of the bucket, in bytes. If None, the bucket is never full. Type: int Value:
        None

    ### rate Rate the bucket drains, in bytes per second. If None, the bucket drains instantaneously. Type: int Value:
        None

    ### _refcount Type: `int` Value:
        0

Generated by Epydoc 1.1 on Thu May 8 13:18:46 2003 | http://epydoc.sf.net