class documentation

class _AggregateSmallWrites:

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):

Undocumented

def flush(self):

Flush any buffered writes.

def write(self, data: bytes):

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 =

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

Value
64000
def _scheduledFlush(self):

Called in next reactor iteration.

_buffer: list[bytes] =

Undocumented

_bufferLeft =

Undocumented

_clock =

Undocumented

_scheduled: IDelayedCall | None =

Undocumented

_write =

Undocumented