Constructor NatsSvcEndpoint
NatsSvcEndpoint(INatsConnection, string?, string, Func<NatsSvcMsg<T>, ValueTask>, string, IDictionary<string, string>?, INatsDeserialize<T>, NatsSubOpts?, CancellationToken)
Creates a new instance of NatsSvcEndpoint<T>.
public NatsSvcEndpoint(INatsConnection nats, string? queueGroup, string name, Func<NatsSvcMsg<T>, ValueTask> handler, string subject, IDictionary<string, string>? metadata, INatsDeserialize<T> serializer, NatsSubOpts? opts, CancellationToken cancellationToken)
Parameters
nats
INatsConnectionNATS connection.
queueGroup
stringQueue group.
name
stringOptional endpoint name.
handler
Func<NatsSvcMsg<T>, ValueTask>Callback function to handle messages received.
subject
stringOptional subject name.
metadata
IDictionary<string, string>Endpoint metadata.
serializer
INatsDeserialize<T>Serializer to use for the message type.
opts
NatsSubOptsSubscription options.
cancellationToken
CancellationTokenA CancellationToken used to cancel the API call.