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.

Undocumented

_bufferLeft = (source)

Undocumented

Undocumented

Undocumented

Undocumented