faust.types.tuples

class faust.types.tuples.ConsumerMessage(topic: str, partition: int, offset: int, timestamp: float, timestamp_type: int, headers: Optional[Union[List[Tuple[str, bytes]], Mapping[str, bytes]]], key: Optional[bytes], value: Optional[bytes], checksum: Optional[bytes], serialized_key_size: Optional[int] = None, serialized_value_size: Optional[int] = None, tp: Optional[TP] = None, time_in: Optional[float] = None, time_out: Optional[float] = None, time_total: Optional[float] = None, generation_id: Optional[int] = None)[source]

Message type used by Kafka Consumer.

topic: str
partition: int
offset: int
timestamp: float
timestamp_type: int
headers: Optional[Union[List[Tuple[str, bytes]], Mapping[str, bytes]]]
key: Optional[bytes]
value: Optional[bytes]
checksum: Optional[bytes]
serialized_key_size: int
serialized_value_size: int
acked: bool
refcount: int
time_in: Optional[float]

Monotonic timestamp of when the consumer received this message.

time_out: Optional[float]

Monotonic timestamp of when the consumer acknowledged this message.

time_total: Optional[float]

Total processing time (in seconds), or None if the event is still processing.

tp
tracked: bool
span
generation_id: Optional[int]
use_tracking: bool = True
on_final_ack(consumer: _ConsumerT) bool[source]
Return type:

bool

class faust.types.tuples.FutureMessage(message: PendingMessage)[source]
message: PendingMessage
set_result(result: RecordMetadata) None[source]

Mark the future done and set its result.

If the future is already done when this method is called, raises InvalidStateError.

Return type:

None

class faust.types.tuples.Message(topic: str, partition: int, offset: int, timestamp: float, timestamp_type: int, headers: Optional[Union[List[Tuple[str, bytes]], Mapping[str, bytes]]], key: Optional[bytes], value: Optional[bytes], checksum: Optional[bytes], serialized_key_size: Optional[int] = None, serialized_value_size: Optional[int] = None, tp: Optional[TP] = None, time_in: Optional[float] = None, time_out: Optional[float] = None, time_total: Optional[float] = None, generation_id: Optional[int] = None)[source]
use_tracking: bool = False
topic: str
partition: int
offset: int
timestamp: float
timestamp_type: int
headers: Optional[Union[List[Tuple[str, bytes]], Mapping[str, bytes]]]
key: Optional[bytes]
value: Optional[bytes]
checksum: Optional[bytes]
serialized_key_size: int
serialized_value_size: int
acked: bool
refcount: int
tp
tracked: bool
time_in: Optional[float]

Monotonic timestamp of when the consumer received this message.

time_out: Optional[float]

Monotonic timestamp of when the consumer acknowledged this message.

time_total: Optional[float]

Total processing time (in seconds), or None if the event is still processing.

generation_id: Optional[int]
ack(consumer: _ConsumerT, n: int = 1) bool[source]
Return type:

bool

on_final_ack(consumer: _ConsumerT) bool[source]
Return type:

bool

incref(n: int = 1) None[source]
Return type:

None

decref(n: int = 1) int[source]
Return type:

int

classmethod from_message(message: Any, tp: TP) Message[source]
Return type:

Message

span
class faust.types.tuples.PendingMessage(channel, key, value, partition, timestamp, headers, key_serializer, value_serializer, callback, topic, offset, generation_id)[source]
channel: _ChannelT

Alias for field number 0

key: Optional[Union[bytes, _ModelT, Any]]

Alias for field number 1

value: Union[bytes, _ModelT, Any]

Alias for field number 2

partition: Optional[int]

Alias for field number 3

timestamp: Optional[float]

Alias for field number 4

headers: Optional[Union[List[Tuple[str, bytes]], MutableMapping[str, bytes]]]

Alias for field number 5

key_serializer: Optional[Union[CodecT, str]]

Alias for field number 6

value_serializer: Optional[Union[CodecT, str]]

Alias for field number 7

callback: Optional[Callable[[FutureMessage], Union[None, Awaitable[None]]]]

Alias for field number 8

topic: Optional[str]

Alias for field number 9

offset: Optional[int]

Alias for field number 10

generation_id: Optional[int]

Alias for field number 11

class faust.types.tuples.RecordMetadata(topic, partition, topic_partition, offset, timestamp, timestamp_type)[source]
topic: str

Alias for field number 0

partition: int

Alias for field number 1

topic_partition: TP

Alias for field number 2

offset: int

Alias for field number 3

timestamp: Optional[float]

Alias for field number 4

timestamp_type: Optional[int]

Alias for field number 5

class faust.types.tuples.TP(topic, partition)[source]
topic: str

Alias for field number 0

partition: int

Alias for field number 1

faust.types.tuples.tp_set_to_map(tps: Set[TP]) MutableMapping[str, Set[TP]][source]
Return type:

_GenericAlias[str, _GenericAlias[TP]]