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`.`tls`.`_AggregateSmallWrites``

class documentation

`class _AggregateSmallWrites: (source)`

Constructor: `_AggregateSmallWrites(write, clock)`

View In Hierarchy

Aggregate small writes so they get written in large batches.

If this is used as part of a transport, the transport needs to call ``flush()`` immediately when ``loseConnection()`` is called, otherwise any buffered writes will never get written.

Method | `__init__` | Undocumented
Method | `flush` | Flush any buffered writes.
Method | `write` | Buffer the data, or write it immediately if we've accumulated enough to make it worth it.
Constant | `MAX_BUFFER_SIZE` | The maximum amount of bytes to buffer before writing them out.
Method | `_scheduledFlush` | Called in next reactor iteration.
Instance Variable | `_buffer` | Undocumented
Instance Variable | `_bufferLeft` | Undocumented
Instance Variable | `_clock` | Undocumented
Instance Variable | `_scheduled` | Undocumented
Instance Variable | `_write` | Undocumented

def __init__(self, write: `Callable[[bytes], object]`, clock: `IReactorTime`): (source)

Undocumented

def flush(self): (source)

Flush any buffered writes.

def write(self, data: `bytes`): (source)

Buffer the data, or write it immediately if we've accumulated enough to make it worth it.

Accumulating too much data can result in higher memory usage.

MAX_BUFFER_SIZE: `int` = (source)

The maximum amount of bytes to buffer before writing them out.

Value

    64000

def _scheduledFlush(self): (source)

Called in next reactor iteration.

_buffer: `list[bytes]` = (source)

Undocumented

_bufferLeft = (source)

Undocumented

_clock = (source)

Undocumented

_scheduled: `Optional[IDelayedCall]` = (source)

Undocumented

_write = (source)

Undocumented