Part of twisted.protocols.basic View Source View In Hierarchy
This is a helper for protocols that, at some point, will take a file-like object, read its contents, and write them out to the network, optionally performing some transformation on the bytes in between.
Method | beginFileTransfer | Begin transferring a file |
Method | resumeProducing | Undocumented |
Method | pauseProducing | Undocumented |
Method | stopProducing | Undocumented |
Parameters | file | The file object to read data from (type: Any file-like object) |
consumer | The object to write data to (type: Any implementor of IConsumer) | |
transform | A callable taking one string argument and returning the same. All bytes read from the file are passed through this before being written to the consumer. | |
Returns | A deferred whose callback will be invoked when the file has been completely
written to the consumer. The last byte written to the consumer is passed to
the callback. (type: Deferred ) |