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.
ValueTask AddSubAsync(NatsSubBase sub, CancellationToken cancellationToken = default)
Parameters
subNatsSubBaseThe NatsSubBase object representing the subscription details.
cancellationTokenCancellationTokenA CancellationToken used to cancel the operation.