towhee.runtime.data_queue.DataQueue¶
- class towhee.runtime.data_queue.DataQueue(schema_info, max_size=1000)[source]¶
Bases:
object
Col-based storage.
Methods
batch_put
batch_put_dict
clear_and_seal
col_type
get
get_dict
put
put_dict
seal
Attributes
col_size
max_size
Return the schema of the DataQueue.
sealed
size
Return the type of queues in the DataQueue.
- property schema: List[str]¶
Return the schema of the DataQueue.
Examples
>>> from towhee.runtime.data_queue import DataQueue, ColumnType >>> dq = DataQueue([('a', ColumnType.SCALAR), ('b', ColumnType.QUEUE)]) >>> dq.put(('a', 'b1')) True >>> dq.schema ['a', 'b']
- property type_schema: List[str]¶
Return the type of queues in the DataQueue.
Examples
>>> from towhee.runtime.data_queue import DataQueue, ColumnType >>> dq = DataQueue([('a', ColumnType.SCALAR), ('b', ColumnType.QUEUE)]) >>> dq.put(('a', 'b1')) True >>> dq.type_schema [<ColumnType.SCALAR: 2>, <ColumnType.QUEUE: 1>]