Bases: StreamMessage[MsgType]
A class to represent a Redis ACK mixin.
committed class-attribute
instance-attribute
committed: bool = field(default=False, init=False)
content_type class-attribute
instance-attribute
correlation_id class-attribute
instance-attribute
decoded_body class-attribute
instance-attribute
decoded_body: Optional[DecodedMessage] = None
headers: AnyDict = field(default_factory=dict)
message_id class-attribute
instance-attribute
path class-attribute
instance-attribute
processed class-attribute
instance-attribute
processed: bool = field(default=False, init=False)
raw_message instance-attribute
reply_to class-attribute
instance-attribute
ack async
ack(redis: Redis[bytes], **kwargs: Any) -> None
Source code in faststream/redis/message.py
| @override
async def ack( # type: ignore[override]
self,
redis: "Redis[bytes]",
**kwargs: Any,
) -> None:
handler: Optional["Handler"]
if (
not self.committed
and (ids := self.raw_message.get("message_ids"))
and (handler := context.get_local("handler_")) is not None
and (stream := handler.stream_sub)
and (group := stream.group)
):
await redis.xack(self.raw_message["channel"], group, *ids) # type: ignore[no-untyped-call]
await super().ack()
|
nack async
nack(**kwargs: Any) -> None
Source code in faststream/broker/message.py
| async def nack(self, **kwargs: Any) -> None:
self.committed = True
|
reject async
reject(**kwargs: Any) -> None
Source code in faststream/broker/message.py
| async def reject(self, **kwargs: Any) -> None:
self.committed = True
|