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, headers: Optional[Dict[str, str]] = None, reply_to: str = '', correlation_id: Optional[str] = None, *, rpc: bool = False, rpc_timeout: Optional[float] = 30.0, raise_timeout: bool = False) -> Optional[Any]