faust.transport.conductor

The conductor delegates messages from the consumer to the streams.

class faust.transport.conductor.ConductorCompiler[source]

Compile a function to handle the messages for a topic+partition.

build(conductor: faust.transport.conductor.Conductor, tp: faust.types.tuples.TP, channels: MutableSet[faust.transport.conductor._Topic]) → Callable[faust.types.tuples.Message, Awaitable][source]

Generate closure used to deliver messages.

Return type

Callable[[Message], Awaitable[+T_co]]

class faust.transport.conductor.Conductor(app: faust.types.app.AppT, **kwargs: Any) → None[source]

Manages the channels that subscribe to topics.

  • Consumes messages from topic using a single consumer.

  • Forwards messages to all channels subscribing to a topic.

logger = <Logger faust.transport.conductor (WARNING)>
async commit(topics: AbstractSet[Union[str, faust.types.tuples.TP]]) → bool[source]

Commit offsets in topics.

Return type

bool

acks_enabled_for(topic: str) → bool[source]

Return True if acks are enabled for topic by name.

Return type

bool

async wait_for_subscriptions() → None[source]

Wait for consumer to be subscribed.

Return type

None

async maybe_wait_for_subscriptions() → None[source]
Return type

None

async on_partitions_assigned(assigned: Set[faust.types.tuples.TP]) → None[source]

Call when cluster is rebalancing and partitions are assigned.

Return type

None

async on_client_only_start() → None[source]
Return type

None

clear() → None[source]

Clear all subscriptions.

Return type

None

add(topic: Any) → None[source]

Register topic to be subscribed.

Return type

None

discard(topic: Any) → None[source]

Unregister topic from conductor.

Return type

None

property label

Return label for use in logs. :rtype: str

property shortlabel

Return short label for use in logs. :rtype: str