Package twisted :: Package protocols :: Module htb :: Class ShapedProtocolFactory

[frames | no frames]

## Class ShapedProtocolFactory

I dispense Protocols with traffic shaping on their transports.

Usage:

       myserver = SomeFactory()
       myserver.protocol = ShapedProtocolFactory(myserver.protocol,
                                                 bucketFilter)

Where SomeServerFactory is a `twisted.internet.protocol.Factory`, and bucketFilter is an instance of `HierarchicalBucketFilter`.

Method Summary
| ``__init__`(self, protoClass, bucketFilter)` Tell me what to wrap and where to get buckets.
| ``__call__`(self, *a, **kw)` Make a Protocol instance with a shaped transport.

Method Details

### __init__(self, protoClass, bucketFilter)
(Constructor)

Tell me what to wrap and where to get buckets.

  Parameters:
    `protoClass` - The class of Protocol I will generate wrapped instances of.
    (type=`Protocol` class)
    `bucketFilter` - The filter which will determine how traffic is shaped.
    (type=`HierarchicalBucketFilter`.)

### __call__(self, *a, **kw)
(Call operator)

Make a Protocol instance with a shaped transport.

Any parameters will be passed on to the protocol's initializer.

  Returns:
    a Protocol instance with a `ShapedTransport`.

Generated by Epydoc 2.0 on Sat May 15 20:08:30 2004 | http://epydoc.sf.net