Table of Contents

Constructor NatsSvcEndpoint

Namespace
NATS.Client.Services
Assembly
NATS.Client.Services.dll

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 INatsConnection

NATS connection.

queueGroup string

Queue group.

name string

Optional endpoint name.

handler Func<NatsSvcMsg<T>, ValueTask>

Callback function to handle messages received.

subject string

Optional subject name.

metadata IDictionary<string, string>

Endpoint metadata.

serializer INatsDeserialize<T>

Serializer to use for the message type.

opts NatsSubOpts

Subscription options.

cancellationToken CancellationToken

A CancellationToken used to cancel the API call.