Method PublishAsync
PublishAsync<T>(in NatsMsg<T>, INatsSerialize<T>?, NatsPubOpts?, CancellationToken)
Publishes a serializable message payload to the given subject name, optionally supplying a reply subject.
ValueTask PublishAsync<T>(in NatsMsg<T> msg, INatsSerialize<T>? serializer = null, NatsPubOpts? opts = null, CancellationToken cancellationToken = default)
Parameters
msg
NatsMsg<T>A NatsMsg<T> representing message details.
serializer
INatsSerialize<T>Serializer to use for the message type.
opts
NatsPubOptsA NatsPubOpts for publishing options.
cancellationToken
CancellationTokenA CancellationToken used to cancel the command.
Returns
Type Parameters
T
Specifies the type of data that may be sent to the NATS Server.