faust.transport.utils

Transport utils - scheduling.

class faust.transport.utils.DefaultSchedulingStrategy[source]

Consumer record scheduler.

Delivers records in round robin between both topics and partitions.

classmethod map_from_records(records: Mapping[TP, List]) MutableMapping[str, TopicBuffer][source]

Convert records to topic index map.

Return type:

_GenericAlias[str, TopicBuffer]

iterate(records: Mapping[TP, List]) Iterator[Tuple[TP, Any]][source]

Iterate over records in round-robin order.

Return type:

_GenericAlias[_GenericAlias[TP, Any]]

records_iterator(index: MutableMapping[str, TopicBuffer]) Iterator[Tuple[TP, Any]][source]

Iterate over topic index map in round-robin order.

Return type:

_GenericAlias[_GenericAlias[TP, Any]]

class faust.transport.utils.TopicBuffer[source]

Data structure managing the buffer for incoming records in a topic.

add(tp: TP, buffer: List) None[source]

Add topic partition buffer to the cycle.

Return type:

None