AioPikaParser
faststream.rabbit.parser.AioPikaParser #
A class for parsing, encoding, and decoding messages using aio-pika.
METHOD | DESCRIPTION |
---|---|
parse_message | aio_pika.IncomingMessage) -> StreamMessage[aio_pika.IncomingMessage]: Parses an incoming message and returns a StreamMessage object. |
decode_message | StreamMessage[aio_pika.IncomingMessage]) -> DecodedMessage: Decodes a StreamMessage object and returns a DecodedMessage object. |
encode_message | AioPikaSendableMessage, persist: bool = False, callback_queue: Optional[aio_pika.abc.AbstractRobustQueue] = None, reply_to: Optional[str] = None, **message_kwargs: Any) -> aio_pika.Message: Encodes a message into an aio_pika.Message object. |
Note
The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
decode_message async
staticmethod
#
Decode a message.
PARAMETER | DESCRIPTION |
---|---|
msg | The message to decode. TYPE: |
RETURNS | DESCRIPTION |
---|---|
DecodedMessage | The decoded message. |
Note
The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
Source code in faststream/rabbit/parser.py
encode_message staticmethod
#
encode_message(
message: AioPikaSendableMessage,
persist: bool = False,
callback_queue: Optional[
aio_pika.abc.AbstractRobustQueue
] = None,
reply_to: Optional[str] = None,
**message_kwargs: Any
) -> aio_pika.Message
Encodes a message for sending using AioPika.
PARAMETER | DESCRIPTION |
---|---|
message | The message to encode. TYPE: |
persist | Whether to persist the message. Defaults to False. TYPE: |
callback_queue | The callback queue to use for replies. Defaults to None. TYPE: |
reply_to | The reply-to queue to use for replies. Defaults to None. TYPE: |
**message_kwargs | Additional keyword arguments to include in the encoded message. TYPE: |
RETURNS | DESCRIPTION |
---|---|
Message | aio_pika.Message: The encoded message. |
RAISES | DESCRIPTION |
---|---|
NotImplementedError | If the message is not an instance of aio_pika.Message. |
Note
The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
Source code in faststream/rabbit/parser.py
parse_message async
staticmethod
#
Parses an incoming message and returns a RabbitMessage object.
PARAMETER | DESCRIPTION |
---|---|
message | The incoming message to parse. TYPE: |
RETURNS | DESCRIPTION |
---|---|
StreamMessage[IncomingMessage] | A StreamMessage object representing the parsed message. |
Note
The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)