trinity.buffer.buffer_writer module#

Writer of the buffer.

class trinity.buffer.buffer_writer.BufferWriter[源代码]#

基类:ABC

Interface of the buffer writer.

abstractmethod write(data: List) None[源代码]#

Write to buffer.

abstractmethod async write_async(data: List) None[源代码]#

Write to buffer asynchronously.

abstractmethod async acquire() int[源代码]#

Acquire the buffer writer.

返回:

The reference count of the buffer after acquiring.

返回类型:

int

abstractmethod async release() int[源代码]#

Release the buffer writer. After release, the buffer writer can not be used again.

返回:

The reference count of the buffer after releasing.

返回类型:

int