import { type Msg } from "https://deno.land/x/natsws@v1.28.0/src/mod.ts";
Represents a message delivered by NATS. This interface is used by Subscribers.
Properties
A possible subject where the recipient may publish a reply (in the cases where the message represents a request).
optional
headers: MsgHdrsPossible headers that may have been set by the server or the publisher.
Methods
respond(payload?: Payload, opts?: PublishOptions): boolean
Convenience to publish a response to the reply subject in the
message - this is the same as doing nc.publish(msg.reply, ...)
.
json<T>(reviver?: ReviverFn): T
Convenience method to parse the message payload as JSON. This method will throw an exception if there's a parsing error;