MQTTPublishCommand
faststream.mqtt.response.MQTTPublishCommand #
MQTTPublishCommand(
message: SendableMessage,
*,
topic: str = "",
correlation_id: str | None = None,
headers: dict[str, str] | None = None,
reply_to: str = "",
qos: QoS = AT_MOST_ONCE,
retain: bool = False,
message_expiry_interval: int | None = None,
timeout: float | None = 30.0,
_publish_type: PublishType,
)
Bases: PublishCommand
Source code in faststream/mqtt/response.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
from_cmd classmethod #
from_cmd(
cmd: Union[PublishCommand, MQTTPublishCommand],
) -> MQTTPublishCommand
Source code in faststream/mqtt/response.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
as_publish_command #
as_publish_command() -> PublishCommand
Method to transform handlers' Response result to DTO for publishers.
Source code in faststream/response/response.py
22 23 24 25 26 27 28 29 | |
get_publish_key #
get_publish_key() -> Any | None
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
31 32 33 34 35 36 37 38 39 40 | |
add_headers #
add_headers(
headers: dict[str, Any], *, override: bool = True
) -> None
Source code in faststream/response/response.py
71 72 73 74 75 76 77 78 79 80 | |