Use a token bucket to proxy between a producer (e.g. FileTransfer) and
a consumer (TCP protocol, etc.), doing rate control.
The bucket has a rate and a maximum level, so a small burst can be
permitted. The initial level can be set to a non-zero value, this is
useful to implement burst-on-connect behaviour.
TODO: This almost certainly only works with producers that work like
FileTransfer - i.e. they produce data directly in resumeProducing, and
ignore pauseProducing. This is sufficient for our needs right now.
|
__init__(self,
consumer,
maxLevel,
fillRate,
fillLevel=0) |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
registerProducer(self,
producer,
streaming) |
source code
|
|
|
|
Inherited from extern.log.log.Loggable :
__providedBy__ ,
__provides__ ,
debug ,
doLog ,
error ,
info ,
log ,
logFunction ,
logObjectName ,
warning ,
warningFailure ,
writeMarker
|