Method AddSubAsync
AddSubAsync(NatsSubBase, CancellationToken)
Adds a subscription to the NATS connection for a given NatsSubBase object. Subscriptions are managed by the connection and are automatically removed when the connection is closed.
public ValueTask AddSubAsync(NatsSubBase sub, CancellationToken cancellationToken = default)
Parameters
sub
NatsSubBaseThe NatsSubBase object representing the subscription details.
cancellationToken
CancellationTokenA CancellationToken used to cancel the operation.