Skip to content

Commit

Permalink
chore: added tabulation to docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
doublehomixide committed Jan 4, 2025
1 parent bd07dd9 commit 5296158
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 27 deletions.
57 changes: 38 additions & 19 deletions faststream/rabbit/broker/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,25 +624,44 @@ async def publish(
Please, use @broker.publisher(...) or broker.publisher(...).publish(...) for the regular method of publishing.
Args:
message: Message body to send.
queue: Message routing key to publish with.
exchange: Target exchange to publish message to.
routing_key: Message routing key to publish with. Overrides `queue` option if presented.
mandatory: Client waits for confirmation that the message is placed to some queue. RabbitMQ returns message to client if there is no suitable queue.
immediate: Client expects that there is consumer ready to take the message to work. RabbitMQ returns message to client if there is no suitable consumer.
timeout: Send confirmation time from RabbitMQ.
persist: Restore the message on RabbitMQ reboot.
reply_to: Reply message routing key to send with (always sending to default exchange).
correlation_id: Manual message **correlation_id** setter. **correlation_id** is a useful option to trace messages.
headers: Message headers to store metainformation.
content_type: Message **content-type** header. Used by application, not core RabbitMQ. Will be set automatically if not specified.
content_encoding: Message body content encoding, e.g. **gzip**.
expiration: Message expiration (lifetime) in seconds (or datetime or timedelta).
message_id: Arbitrary message id. Generated automatically if not presented.
timestamp: Message publish timestamp. Generated automatically if not presented.
message_type: Application-specific message type, e.g. **orders.created**.
user_id: Publisher connection User ID, validated if set.
priority: The message priority (0 by default).
message:
Message body to send.
queue:
Message routing key to publish with.
exchange:
Target exchange to publish message to.
routing_key:
Message routing key to publish with. Overrides `queue` option if presented.
mandatory:
Client waits for confirmation that the message is placed to some queue. RabbitMQ returns message to client if there is no suitable queue.
immediate:
Client expects that there is consumer ready to take the message to work. RabbitMQ returns message to client if there is no suitable consumer.
timeout:
Send confirmation time from RabbitMQ.
persist:
Restore the message on RabbitMQ reboot.
reply_to:
Reply message routing key to send with (always sending to default exchange).
correlation_id:
Manual message **correlation_id** setter. **correlation_id** is a useful option to trace messages.
headers:
Message headers to store metainformation.
content_type:
Message **content-type** header. Used by application, not core RabbitMQ. Will be set automatically if not specified.
content_encoding:
Message body content encoding, e.g. **gzip**.
expiration:
Message expiration (lifetime) in seconds (or datetime or timedelta).
message_id:
Arbitrary message id. Generated automatically if not presented.
timestamp:
Message publish timestamp. Generated automatically if not presented.
message_type:
Application-specific message type, e.g. **orders.created**.
user_id:
Publisher connection User ID, validated if set.
priority:
The message priority (0 by default).
Returns:
An optional aiormq.abc.ConfirmationFrameType representing the confirmation frame if RabbitMQ is configured to send confirmations.
Expand Down
24 changes: 16 additions & 8 deletions faststream/redis/broker/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,22 @@ async def publish( # type: ignore[override]
It can be used in other frameworks or to publish messages at specific intervals.
Args:
message: Message body to send.
channel: Redis PubSub object name to send message.
reply_to: Reply message destination PubSub object name.
headers: Message headers to store metainformation.
correlation_id: Manual message correlation_id setter. correlation_id is a useful option to trace messages.
list: Redis List object name to send message.
stream: Redis Stream object name to send message.
maxlen: Redis Stream maxlen publish option. Remove eldest message if maxlen exceeded.
message:
Message body to send.
channel:
Redis PubSub object name to send message.
reply_to:
Reply message destination PubSub object name.
headers:
Message headers to store metainformation.
correlation_id:
Manual message correlation_id setter. correlation_id is a useful option to trace messages.
list:
Redis List object name to send message.
stream:
Redis Stream object name to send message.
maxlen:
Redis Stream maxlen publish option. Remove eldest message if maxlen exceeded.
Returns:
int: The result of the publish operation, typically the number of messages published.
Expand Down

0 comments on commit 5296158

Please sign in to comment.