FakePublisher
faststream.broker.wrapper.FakePublisher #
A class to represent a fake publisher.
METHOD | DESCRIPTION |
---|---|
publish | asynchronously publishes a message with optional correlation ID and additional keyword arguments |
Initialize an object.
PARAMETER | DESCRIPTION |
---|---|
method | A callable that takes any number of arguments and returns an awaitable sendable message. |
Source code in faststream/broker/wrapper.py
publish async
#
publish(message: SendableMessage, correlation_id: Optional[str] = None, **kwargs: Any) -> Optional[SendableMessage]
Publish a message.
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. |