faust.transport.conductor

The conductor delegates messages from the consumer to the streams.

class faust.transport.conductor.Conductor(app: AppT, **kwargs: Any)[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: logging.Logger = <Logger faust.transport.conductor (WARNING)>
app: _AppT
on_message: ConsumerCallback
async commit(topics: AbstractSet[Union[str, 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[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

log: CompositeLogger
diag: DiagT
async_exit_stack: AsyncExitStack
exit_stack: ExitStack
add(topic: TopicT) None[source]

Register topic to be subscribed.

Return type:

None

discard(topic: Any) None[source]

Unregister topic from conductor.

Return type:

None

property label: str

Return label for use in logs. :rtype: str

property shortlabel: str

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

property acking_topics: Set[str]
Return type:

_GenericAlias[str]

class faust.transport.conductor.ConductorCompiler[source]

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

build(conductor: Conductor, tp: TP, channels: MutableSet[_Topic]) Callable[[Message], Awaitable][source]

Generate closure used to deliver messages.

Return type:

_CallableGenericAlias[Message, _SpecialGenericAlias]