faust.transport.utils

Transport utils - scheduling.

faust.transport.utils.TopicIndexMap

alias of typing.MutableMapping

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[faust.types.tuples.TP, List]) → MutableMapping[str, faust.transport.utils.TopicBuffer][source]

Convert records to topic index map.

Return type

MutableMapping[str, TopicBuffer[]]

iterate(records: Mapping[faust.types.tuples.TP, List]) → Iterator[Tuple[faust.types.tuples.TP, Any]][source]

Iterate over records in round-robin order.

Return type

Iterator[Tuple[TP, Any]]

records_iterator(index: MutableMapping[str, TopicBuffer]) → Iterator[Tuple[faust.types.tuples.TP, Any]][source]

Iterate over topic index map in round-robin order.

Return type

Iterator[Tuple[TP, Any]]

class faust.transport.utils.TopicBuffer → None[source]

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

add(tp: faust.types.tuples.TP, buffer: List) → None[source]

Add topic partition buffer to the cycle.

Return type

None