Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`protocols`.`basic`.`FileSender``

class documentation

`class FileSender: (source)`

Implements interfaces: `twisted.internet.interfaces.IProducer`

View In Hierarchy

A producer that sends the contents of a file to a consumer.

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 | `pauseProducing` | Undocumented
Method | `resumeProducing` | Undocumented
Method | `stopProducing` | Stop producing data.
Constant | `CHUNK_SIZE` | Undocumented
Instance Variable | `consumer` | Undocumented
Instance Variable | `deferred` | Undocumented
Instance Variable | `file` | Undocumented
Instance Variable | `lastSent` | Undocumented
Instance Variable | `transform` | Undocumented

def beginFileTransfer(self, file, consumer, transform=None): (source)

Begin transferring a file

Parameters
file:Any file-like object | The file object to read data from
consumer:Any implementor of IConsumer | The object to write data to
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
`Deferred` | 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.

def pauseProducing(self): (source)

Undocumented

def resumeProducing(self): (source)

Undocumented

def stopProducing(self): (source)
from `twisted.internet.interfaces.IProducer`

Stop producing data.

This tells a producer that its consumer has died, so it must stop producing data for good.

CHUNK_SIZE = (source)

Undocumented

Value

    2**14

consumer = (source)

Undocumented

deferred = (source)

Undocumented

file = (source)

Undocumented

lastSent = (source)

Undocumented

transform = (source)

Undocumented