AioPikaFastProducer
faststream.rabbit.producer.AioPikaFastProducer #
AioPikaFastProducer(
channel: aio_pika.RobustChannel,
declarer: RabbitDeclarer,
parser: Optional[
AsyncCustomParser[
aio_pika.IncomingMessage, RabbitMessage
]
],
decoder: Optional[AsyncCustomDecoder[RabbitMessage]],
)
A class for fast producing messages using aio-pika.
METHOD | DESCRIPTION |
---|---|
publish | Publishes a message to a queue or exchange. |
_publish | Publishes a message to an exchange. |
Note: This docstring is incomplete as it is difficult to understand the purpose and functionality of the class and its methods without more context.
Note
The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
Initialize a class instance.
PARAMETER | DESCRIPTION |
---|---|
channel | The aio_pika.RobustChannel object. TYPE: |
declarer | The RabbitDeclarer object. TYPE: |
parser | An optional AsyncCustomParser object for parsing incoming messages. TYPE: |
decoder | An optional AsyncCustomDecoder object for decoding incoming messages. TYPE: |
Note
The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
Source code in faststream/rabbit/producer.py
publish async
#
publish(
message: AioPikaSendableMessage = "",
queue: Union[RabbitQueue, str] = "",
exchange: Union[RabbitExchange, str, None] = None,
*,
routing_key: str = "",
mandatory: bool = True,
immediate: bool = False,
timeout: TimeoutType = None,
rpc: bool = False,
rpc_timeout: Optional[float] = 30.0,
raise_timeout: bool = False,
persist: bool = False,
reply_to: Optional[str] = None,
**message_kwargs: Any
) -> Union[
aiormq.abc.ConfirmationFrameType, SendableMessage
]
Publish a message to a RabbitMQ queue.
PARAMETER | DESCRIPTION |
---|---|
message | The message to be published. TYPE: |
queue | The queue to publish the message to. TYPE: |
exchange | The exchange to publish the message to. TYPE: |
routing_key | The routing key for the message. TYPE: |
mandatory | Whether the message is mandatory. TYPE: |
immediate | Whether the message should be delivered immediately. TYPE: |
timeout | The timeout for the operation. TYPE: |
rpc | Whether the message is for RPC. TYPE: |
rpc_timeout | The timeout for RPC. |
raise_timeout | Whether to raise an exception on timeout. TYPE: |
persist | Whether the message should be persisted. TYPE: |
reply_to | The reply-to queue for RPC. |
**message_kwargs | Additional keyword arguments for the message. TYPE: |
RETURNS | DESCRIPTION |
---|---|
Union[ConfirmationFrameType, SendableMessage] | Union[aiormq.abc.ConfirmationFrameType, SendableMessage]: The result of the publish operation. |
RAISES | DESCRIPTION |
---|---|
WRONG_PUBLISH_ARGS | If reply_to is not None when rpc is True. |
Note
The above docstring is autogenerated by docstring-gen library (https://docstring-gen.airt.ai)
Source code in faststream/rabbit/producer.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|