AsyncPublisherProtocol
faststream.broker.types.AsyncPublisherProtocol #
Bases: Protocol
A protocol for an asynchronous publisher.
publish async #
publish(
message: SendableMessage,
correlation_id: Optional[str] = None,
**kwargs: Any
) -> Optional[SendableMessage]
Publishes a message asynchronously.
| PARAMETER | DESCRIPTION |
|---|---|
message | The message to be published. TYPE: |
correlation_id | Optional correlation ID for the message. |
**kwargs | Additional keyword arguments. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
Optional[SendableMessage] | The published message, or None if the message was not published. |