NatsFastProducer
faststream.nats.producer.NatsFastProducer #
NatsFastProducer(
connection: Client,
parser: Optional[AsyncCustomParser[Msg, NatsMessage]],
decoder: Optional[AsyncCustomDecoder[NatsMessage]],
)
A class to represent a NATS producer.
Initialize the NATS producer.
PARAMETER | DESCRIPTION |
---|---|
connection | The NATS connection. TYPE: |
parser | The parser. TYPE: |
decoder | The decoder. TYPE: |
Source code in faststream/nats/producer.py
publish async
#
publish(
message: SendableMessage,
subject: str,
reply_to: str = "",
headers: Optional[Dict[str, str]] = None,
correlation_id: Optional[str] = None,
*,
rpc: bool = False,
rpc_timeout: Optional[float] = 30.0,
raise_timeout: bool = False
) -> Optional[Any]