RedisPublishCommand
faststream.redis.RedisPublishCommand #
RedisPublishCommand(
message: SendableMessage,
/,
*messages: SendableMessage,
_publish_type: PublishType,
correlation_id: str | None = None,
channel: str | None = None,
list: str | None = None,
stream: str | None = None,
maxlen: int | None = None,
headers: dict[str, Any] | None = None,
reply_to: str = "",
timeout: float | None = 30.0,
pipeline: Optional[Pipeline[bytes]] = None,
message_format: type[
MessageFormat
] = BinaryMessageFormatV1,
)
Bases: BatchPublishCommand
Source code in faststream/redis/response.py
as_publish_command #
as_publish_command() -> PublishCommand
Method to transform handlers' Response result to DTO for publishers.
Source code in faststream/response/response.py
get_publish_key #
Get the key for publishing this message.
Override this method in subclasses to provide broker-specific keys. Default implementation returns None (no key).
| RETURNS | DESCRIPTION |
|---|---|
Any | None | The key for publishing, or None if this Response type doesn't use keys. |
Source code in faststream/response/response.py
add_headers #
set_destination #
set_destination(
*,
channel: str | None = None,
list: str | None = None,
stream: str | None = None,
) -> None
Source code in faststream/redis/response.py
from_cmd classmethod #
from_cmd(
cmd: Union[PublishCommand, RedisPublishCommand],
*,
batch: bool = False,
message_format: type[
MessageFormat
] = BinaryMessageFormatV1,
) -> RedisPublishCommand