Class DynamoDbEventStoreStreamsSubscription
- Namespace
- Excalibur.EventSourcing.DynamoDb
- Assembly
- Excalibur.EventSourcing.DynamoDb.dll
DynamoDB Streams subscription for the event store.
public sealed class DynamoDbEventStoreStreamsSubscription : IChangeFeedSubscription<CloudStoredEvent>, IAsyncDisposable
- Inheritance
-
DynamoDbEventStoreStreamsSubscription
- Implements
- Inherited Members
Constructors
DynamoDbEventStoreStreamsSubscription(IAmazonDynamoDB, IAmazonDynamoDBStreams, DynamoDbEventStoreOptions, ILogger)
Initializes a new instance of the DynamoDbEventStoreStreamsSubscription class.
public DynamoDbEventStoreStreamsSubscription(IAmazonDynamoDB client, IAmazonDynamoDBStreams streamsClient, DynamoDbEventStoreOptions options, ILogger logger)
Parameters
clientIAmazonDynamoDBThe DynamoDB client.
streamsClientIAmazonDynamoDBStreamsThe DynamoDB Streams client.
optionsDynamoDbEventStoreOptionsThe event store options.
loggerILoggerThe logger.
Properties
CurrentContinuationToken
public string? CurrentContinuationToken { get; }
Property Value
IsActive
Gets a value indicating whether the subscription is active.
public bool IsActive { get; }
Property Value
SubscriptionId
Gets the subscription identifier.
public string SubscriptionId { get; }
Property Value
Methods
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()
Returns
- ValueTask
A task that represents the asynchronous dispose operation.
ReadChangesAsync(CancellationToken)
Gets the async enumerable of change events.
public IAsyncEnumerable<IChangeFeedEvent<CloudStoredEvent>> ReadChangesAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- IAsyncEnumerable<IChangeFeedEvent<CloudStoredEvent>>
An async enumerable of change feed events.
StartAsync(CancellationToken)
Starts the subscription and begins receiving changes.
public Task StartAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
A task representing the subscription startup.
StopAsync(CancellationToken)
Stops the subscription gracefully.
public Task StopAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
A task representing the graceful shutdown.