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

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[NoneType]], on_partitions_assigned: Callable[Set[faust.types.tuples.TP], Awaitable[NoneType]], *, commit_interval: float = None, loop: asyncio.events.AbstractEventLoop = None, **kwargs) → 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.

track_message(message: faust.types.tuples.Message) → None[source]
Return type:None
ack(message: faust.types.tuples.Message) → bool[source]
Return type:bool
assignment() → Set[faust.types.tuples.TP][source]
Return type:Set[TP]
highwater(tp: faust.types.tuples.TP) → int[source]
Return type:int
close() → None[source]
Return type:None
unacked
coroutine commit(self, topics: AbstractSet[Union[str, faust.types.tuples.TP]] = None) → bool[source]
Return type:bool
coroutine create_topic(self, 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
coroutine earliest_offsets(self, *partitions) → MutableMapping[faust.types.tuples.TP, int][source]
Return type:MutableMapping[TP, int]
coroutine getmany(self, timeout: float) → AsyncIterator[Tuple[faust.types.tuples.TP, faust.types.tuples.Message]][source]
coroutine highwaters(self, *partitions) → MutableMapping[faust.types.tuples.TP, int][source]
Return type:MutableMapping[TP, int]
coroutine on_task_error(self, exc: BaseException) → None[source]
Return type:None
coroutine pause_partitions(self, tps: Iterable[faust.types.tuples.TP]) → None[source]
Return type:None
coroutine perform_seek(self) → None[source]
Return type:None
coroutine position(self, tp: faust.types.tuples.TP) → Union[int, NoneType][source]
Return type:Optional[int]
coroutine resume_partitions(self, tps: Iterable[faust.types.tuples.TP]) → None[source]
Return type:None
coroutine seek(self, partition: faust.types.tuples.TP, offset: int) → None[source]
Return type:None
coroutine subscribe(self, topics: Iterable[str]) → None[source]
Return type:None
coroutine wait_empty(self) → None[source]
Return type:None
class faust.types.transports.ProducerT(transport: faust.types.transports.TransportT, loop: asyncio.events.AbstractEventLoop = None, **kwargs) → None[source]
transport = None

The transport that created this Producer.

key_partition(topic: str, key: bytes) → faust.types.tuples.TP[source]
Return type:TP
coroutine create_topic(self, 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
coroutine send(self, topic: str, key: Union[bytes, NoneType], value: Union[bytes, NoneType], partition: Union[int, NoneType]) → Awaitable[faust.types.tuples.RecordMetadata][source]
Return type:Awaitable[RecordMetadata]
coroutine send_and_wait(self, topic: str, key: Union[bytes, NoneType], value: Union[bytes, NoneType], partition: Union[int, NoneType]) → faust.types.tuples.RecordMetadata[source]
Return type:RecordMetadata
class faust.types.transports.ConductorT(app: faust.types.transports.AppT, **kwargs) → None[source]
acks_enabled_for(topic: str) → bool[source]
Return type:bool
coroutine commit(self, topics: AbstractSet[Union[str, faust.types.tuples.TP]]) → bool[source]
Return type:bool
coroutine on_partitions_assigned(self, assigned: Set[faust.types.tuples.TP]) → None[source]
Return type:None
coroutine on_partitions_revoked(self, revoked: Set[faust.types.tuples.TP]) → None[source]
Return type:None
coroutine wait_for_subscriptions(self) → None[source]
Return type:None
class faust.types.transports.TransportT(url: Union[str, 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.

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

The URL to use for this transport (e.g. kafka – //localhost).

driver_version = None

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

create_consumer(callback: Callable[faust.types.tuples.Message, Awaitable], **kwargs) → faust.types.transports.ConsumerT[source]
Return type:ConsumerT[]
create_producer(**kwargs) → faust.types.transports.ProducerT[source]
Return type:ProducerT[]
create_conductor(**kwargs) → faust.types.transports.ConductorT[source]
Return type:ConductorT[]