faust.types.transports

faust.types.transports.ConsumerCallback

alias of typing.Callable

faust.types.transports.TPorTopicSet

alias of typing.AbstractSet

faust.types.transports.PartitionsRevokedCallback

alias of typing.Callable

faust.types.transports.PartitionsAssignedCallback

alias of typing.Callable

faust.types.transports.PartitionerT

alias of typing.Callable

class faust.types.transports.ProducerT(transport: faust.types.transports.TransportT, loop: asyncio.events.AbstractEventLoop = None, **kwargs: Any) → None[source]
transport = None

The transport that created this Producer.

abstract async send(topic: str, key: Optional[bytes], value: Optional[bytes], partition: Optional[int], timestamp: Optional[float], headers: Union[List[Tuple[str, bytes]], Mapping[str, bytes], None], *, transactional_id: str = None) → Awaitable[faust.types.tuples.RecordMetadata][source]
Return type

Awaitable[RecordMetadata]

abstract async send_and_wait(topic: str, key: Optional[bytes], value: Optional[bytes], partition: Optional[int], timestamp: Optional[float], headers: Union[List[Tuple[str, bytes]], Mapping[str, bytes], None], *, transactional_id: str = None) → faust.types.tuples.RecordMetadata[source]
Return type

RecordMetadata

abstract async create_topic(topic: str, partitions: int, replication: int, *, config: Mapping[str, Any] = None, timeout: Union[datetime.timedelta, float, str] = 1000.0, retention: Union[datetime.timedelta, float, str] = None, compacting: bool = None, deleting: bool = None, ensure_created: bool = False) → None[source]
Return type

None

abstract key_partition(topic: str, key: bytes) → faust.types.tuples.TP[source]
Return type

TP

abstract async flush() → None[source]
Return type

None

abstract async begin_transaction(transactional_id: str) → None[source]
Return type

None

abstract async commit_transaction(transactional_id: str) → None[source]
Return type

None

abstract async abort_transaction(transactional_id: str) → None[source]
Return type

None

abstract async stop_transaction(transactional_id: str) → None[source]
Return type

None

abstract async maybe_begin_transaction(transactional_id: str) → None[source]
Return type

None

abstract async commit_transactions(tid_to_offset_map: Mapping[str, Mapping[faust.types.tuples.TP, int]], group_id: str, start_new_transaction: bool = True) → None[source]
Return type

None

abstract supports_headers() → bool[source]
Return type

bool

class faust.types.transports.TransactionManagerT(transport: faust.types.transports.TransportT, loop: asyncio.events.AbstractEventLoop = None, *, consumer: faust.types.transports.ConsumerT, producer: faust.types.transports.ProducerT, **kwargs: Any) → None[source]
abstract async on_partitions_revoked(revoked: Set[faust.types.tuples.TP]) → None[source]
Return type

None

abstract async on_rebalance(assigned: Set[faust.types.tuples.TP], revoked: Set[faust.types.tuples.TP], newly_assigned: Set[faust.types.tuples.TP]) → None[source]
Return type

None

abstract async commit(offsets: Mapping[faust.types.tuples.TP, int], start_new_transaction: bool = True) → bool[source]
Return type

bool

async begin_transaction(transactional_id: str) → None[source]
Return type

None

async commit_transaction(transactional_id: str) → None[source]
Return type

None

async abort_transaction(transactional_id: str) → None[source]
Return type

None

async stop_transaction(transactional_id: str) → None[source]
Return type

None

async maybe_begin_transaction(transactional_id: str) → None[source]
Return type

None

async commit_transactions(tid_to_offset_map: Mapping[str, Mapping[faust.types.tuples.TP, int]], group_id: str, start_new_transaction: bool = True) → None[source]
Return type

None

class faust.types.transports.ConsumerT(transport: faust.types.transports.TransportT, callback: Callable[faust.types.tuples.Message, Awaitable], on_partitions_revoked: Callable[Set[faust.types.tuples.TP], Awaitable[None]], on_partitions_assigned: Callable[Set[faust.types.tuples.TP], Awaitable[None]], *, commit_interval: float = None, loop: asyncio.events.AbstractEventLoop = None, **kwargs: Any) → None[source]
transport = None

The transport that created this Consumer.

commit_interval = None

How often we commit topic offsets. See broker_commit_interval.

randomly_assigned_topics = None

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.

abstract async create_topic(topic: str, partitions: int, replication: int, *, config: Mapping[str, Any] = None, timeout: Union[datetime.timedelta, float, str] = 1000.0, retention: Union[datetime.timedelta, float, str] = None, compacting: bool = None, deleting: bool = None, ensure_created: bool = False) → None[source]
Return type

None

abstract async subscribe(topics: Iterable[str]) → None[source]
Return type

None

abstract async getmany(timeout: float) → AsyncIterator[Tuple[faust.types.tuples.TP, faust.types.tuples.Message]][source]
abstract track_message(message: faust.types.tuples.Message) → None[source]
Return type

None

abstract async perform_seek() → None[source]
Return type

None

abstract ack(message: faust.types.tuples.Message) → bool[source]
Return type

bool

abstract async wait_empty() → None[source]
Return type

None

abstract assignment() → Set[faust.types.tuples.TP][source]
Return type

Set[TP]

abstract highwater(tp: faust.types.tuples.TP) → int[source]
Return type

int

abstract stop_flow() → None[source]
Return type

None

abstract resume_flow() → None[source]
Return type

None

abstract pause_partitions(tps: Iterable[faust.types.tuples.TP]) → None[source]
Return type

None

abstract resume_partitions(tps: Iterable[faust.types.tuples.TP]) → None[source]
Return type

None

abstract async position(tp: faust.types.tuples.TP) → Optional[int][source]
Return type

Optional[int]

abstract async seek(partition: faust.types.tuples.TP, offset: int) → None[source]
Return type

None

abstract async seek_wait(partitions: Mapping[faust.types.tuples.TP, int]) → None[source]
Return type

None

abstract async commit(topics: AbstractSet[Union[str, faust.types.tuples.TP]] = None, start_new_transaction: bool = True) → bool[source]
Return type

bool

abstract async on_task_error(exc: BaseException) → None[source]
Return type

None

abstract async earliest_offsets(*partitions: faust.types.tuples.TP) → Mapping[faust.types.tuples.TP, int][source]
Return type

Mapping[TP, int]

abstract async highwaters(*partitions: faust.types.tuples.TP) → Mapping[faust.types.tuples.TP, int][source]
Return type

Mapping[TP, int]

abstract topic_partitions(topic: str) → Optional[int][source]
Return type

Optional[int]

abstract key_partition(topic: str, key: Optional[bytes], partition: int = None) → Optional[int][source]
Return type

Optional[int]

abstract close() → None[source]
Return type

None

abstract property unacked
Return type

Set[Message]

class faust.types.transports.ConductorT(app: faust.types.transports._AppT, **kwargs: Any) → None[source]
abstract acks_enabled_for(topic: str) → bool[source]
Return type

bool

abstract async commit(topics: AbstractSet[Union[str, faust.types.tuples.TP]]) → bool[source]
Return type

bool

abstract async wait_for_subscriptions() → None[source]
Return type

None

abstract async maybe_wait_for_subscriptions() → None[source]
Return type

None

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

None

class faust.types.transports.TransportT(url: List[yarl.URL], app: faust.types.transports._AppT, loop: asyncio.events.AbstractEventLoop = None) → None[source]
Consumer = None

The Consumer class used for this type of transport.

Producer = None

The Producer class used for this type of transport.

TransactionManager = None

The TransactionManager class used for managing multiple transactions.

Conductor = None

The Conductor class used to delegate messages from Consumer to streams.

Fetcher = None

The Fetcher service used for this type of transport.

app = None

The faust.App that created this transport.

url = None

//localhost).

Type

The URL to use for this transport (e.g. kafka

driver_version = None

String identifying the underlying driver used for this transport. E.g. for aiokafka this could be aiokafka 0.4.1.

abstract create_consumer(callback: Callable[faust.types.tuples.Message, Awaitable], **kwargs: Any) → faust.types.transports.ConsumerT[source]
Return type

ConsumerT[]

abstract create_producer(**kwargs: Any) → faust.types.transports.ProducerT[source]
Return type

ProducerT[]

abstract create_transaction_manager(consumer: faust.types.transports.ConsumerT, producer: faust.types.transports.ProducerT, **kwargs: Any) → faust.types.transports.TransactionManagerT[source]
Return type

TransactionManagerT[]

abstract create_conductor(**kwargs: Any) → faust.types.transports.ConductorT[source]
Return type

ConductorT[]