SubscribeMessagesAsync Method
Definition
- Namespace
- Savvyio.Extensions.NATS.EventDriven
- Assemblies
- Savvyio.Extensions.NATS.dll
SubscribeMessagesAsync(string, NatsSubOpts, CancellationToken)
Subscribes to NATS messages.
protected virtual IAsyncEnumerable<NatsEventBus.ReceivedNatsMessage> SubscribeMessagesAsync(string subject, NatsSubOpts options, CancellationToken cancellationToken)
Parameters
subjectstringThe subject to subscribe to.
optionsNatsSubOptsThe subscription options.
cancellationTokenCancellationTokenThe cancellation token of the asynchronous operation.
Returns
- IAsyncEnumerable<NatsEventBus.ReceivedNatsMessage>
An asynchronous sequence of received NATS messages.