faust.types.transports
¶
- faust.types.transports.ConsumerCallback¶
Callback called by
faust.transport.base.Consumer
whenever a message is received.
- faust.types.transports.PartitionsRevokedCallback¶
Callback (
async def
) called when consumer partitions are revoked.
- faust.types.transports.PartitionsAssignedCallback¶
Callback (
async def
) called when consumer partitions are assigned.
- class faust.types.transports.ConsumerT(transport: TransportT, callback: Callable[[Message], Awaitable], on_partitions_revoked: Callable[[Set[TP]], Awaitable[None]], on_partitions_assigned: Callable[[Set[TP]], Awaitable[None]], *, commit_interval: Optional[float] = None, loop: Optional[AbstractEventLoop] = None, **kwargs: Any)[source]¶
- transport: TransportT¶
The transport that created this Consumer.
- transactions: TransactionManagerT¶
- commit_interval: float¶
How often we commit topic offsets. See
broker_commit_interval
.
- randomly_assigned_topics: Set[str]¶
Set of topic names that are considered “randomly assigned”. This means we don’t crash if it’s not part of our assignment. Used by e.g. the leader assignor service.
- scheduler: SchedulingStrategyT¶
- abstract async create_topic(topic: str, partitions: int, replication: int, *, config: Optional[Mapping[str, Any]] = None, timeout: Union[timedelta, float, str] = 1000.0, retention: Optional[Union[timedelta, float, str]] = None, compacting: Optional[bool] = None, deleting: Optional[bool] = None, ensure_created: bool = False) None [source]¶
- Return type:
None
- abstract async commit(topics: Optional[AbstractSet[Union[str, TP]]] = None, start_new_transaction: bool = True) bool [source]¶
- Return type:
- abstract async on_task_error(exc: BaseException) None [source]¶
- Return type:
None
- abstract topic_partitions(topic: str) Optional[int] [source]¶
- Return type:
_UnionGenericAlias
[int
,None
]
- class faust.types.transports.ProducerT(transport: TransportT, loop: Optional[AbstractEventLoop] = None, **kwargs: Any)[source]¶
- transport: TransportT¶
The transport that created this Producer.
- buffer: ProducerBufferT¶
- ssl_context: Optional[SSLContext]¶
- abstract async send(topic: str, key: Optional[bytes], value: Optional[bytes], partition: Optional[int], timestamp: Optional[float], headers: Optional[Union[List[Tuple[str, bytes]], Mapping[str, bytes]]], *, transactional_id: Optional[str] = None) Awaitable[RecordMetadata] [source]¶
- Return type:
_GenericAlias
[RecordMetadata
]
- abstract send_soon(fut: FutureMessage) None [source]¶
- Return type:
None
- abstract async send_and_wait(topic: str, key: Optional[bytes], value: Optional[bytes], partition: Optional[int], timestamp: Optional[float], headers: Optional[Union[List[Tuple[str, bytes]], Mapping[str, bytes]]], *, transactional_id: Optional[str] = None) RecordMetadata [source]¶
- Return type:
- abstract async create_topic(topic: str, partitions: int, replication: int, *, config: Optional[Mapping[str, Any]] = None, timeout: Union[timedelta, float, str] = 1000.0, retention: Optional[Union[timedelta, float, str]] = None, compacting: Optional[bool] = None, deleting: Optional[bool] = None, ensure_created: bool = False) None [source]¶
- Return type:
None
- class faust.types.transports.TransactionManagerT(transport: TransportT, loop: Optional[AbstractEventLoop] = None, *, consumer: ConsumerT, producer: ProducerT, **kwargs: Any)[source]¶
-
- abstract async on_rebalance(assigned: Set[TP], revoked: Set[TP], newly_assigned: Set[TP]) None [source]¶
- Return type:
None
- class faust.types.transports.TransportT(url: List[URL], app: _AppT, loop: Optional[AbstractEventLoop] = None)[source]¶
-
- TransactionManager: ClassVar[Type[TransactionManagerT]]¶
The TransactionManager class used for managing multiple transactions.
- Conductor: ClassVar[Type[ConductorT]]¶
The Conductor class used to delegate messages from Consumer to streams.
- driver_version: str¶
String identifying the underlying driver used for this transport. E.g. for https://pypi.org/project/aiokafka/ this could be
aiokafka 0.4.1
.
- loop: AbstractEventLoop¶
- abstract create_consumer(callback: Callable[[Message], Awaitable], **kwargs: Any) ConsumerT [source]¶
- Return type:
- abstract create_conductor(**kwargs: Any) ConductorT [source]¶
- Return type: