trinity.buffer.reader.queue_reader module#

Reader of the Queue buffer.

class trinity.buffer.reader.queue_reader.QueueReader(config: StorageConfig)[source]#

Bases: BufferReader

Reader of the Queue buffer.

__init__(config: StorageConfig)[source]#
read(batch_size: int | None = None) List[source]#

Read from buffer.

async read_async(batch_size: int | None = None) List[source]#

Read from buffer asynchronously.

state_dict() Dict[source]#

Return the state of the reader as a dict. :returns: A dict containing the reader state. At minimum, it should contain

the current_index field.

load_state_dict(state_dict)[source]#