Table of Contents

SubscribeMessagesAsync Method

Definition

Namespace
Savvyio.Extensions.NATS.EventDriven
Assemblies
Savvyio.Extensions.NATS.dll
Source
src/Savvyio.Extensions.NATS/EventDriven/NatsEventBus.cs

SubscribeMessagesAsync(string, NatsSubOpts, CancellationToken)

Subscribes to NATS messages.

protected virtual IAsyncEnumerable<NatsEventBus.ReceivedNatsMessage> SubscribeMessagesAsync(string subject, NatsSubOpts options, CancellationToken cancellationToken)

Parameters

subject string

The subject to subscribe to.

options NatsSubOpts

The subscription options.

cancellationToken CancellationToken

The cancellation token of the asynchronous operation.

Returns

IAsyncEnumerable<NatsEventBus.ReceivedNatsMessage>

An asynchronous sequence of received NATS messages.