Interface IEventualConsistencyTracker
- Namespace
- Excalibur.Data.ElasticSearch.Projections
- Assembly
- Excalibur.Data.ElasticSearch.dll
Tracks and monitors eventual consistency between write and read models.
public interface IEventualConsistencyTracker
Methods
GetConsistencyLagAsync(string, CancellationToken)
Gets the current consistency lag for a specific projection type.
Task<ConsistencyLag> GetConsistencyLagAsync(string projectionType, CancellationToken cancellationToken)
Parameters
projectionTypestringThe type of projection to check.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<ConsistencyLag>
The consistency lag information.
GetLaggingEventsAsync(TimeSpan, int, CancellationToken)
Gets events that have not been processed within the expected time window.
Task<IEnumerable<LaggingEvent>> GetLaggingEventsAsync(TimeSpan expectedProcessingTime, int maxResults, CancellationToken cancellationToken)
Parameters
expectedProcessingTimeTimeSpanThe expected maximum processing time.
maxResultsintMaximum number of results to return.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<IEnumerable<LaggingEvent>>
A collection of lagging events.
IsEventFullyProcessedAsync(string, CancellationToken)
Checks if a specific event has been processed by all projections.
Task<bool> IsEventFullyProcessedAsync(string eventId, CancellationToken cancellationToken)
Parameters
eventIdstringThe event identifier to check.
cancellationTokenCancellationTokenThe cancellation token.
Returns
TrackReadModelProjectionAsync(string, string, DateTime, CancellationToken)
Records when a projection is updated in the read model.
Task TrackReadModelProjectionAsync(string eventId, string projectionType, DateTime timestamp, CancellationToken cancellationToken)
Parameters
eventIdstringThe event identifier that triggered the projection update.
projectionTypestringThe type of projection updated.
timestampDateTimeThe timestamp when the projection was updated.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task
A task representing the asynchronous tracking operation.
TrackWriteModelEventAsync(string, string, string, DateTime, CancellationToken)
Records when an event is written to the write model.
Task TrackWriteModelEventAsync(string eventId, string aggregateId, string eventType, DateTime timestamp, CancellationToken cancellationToken)
Parameters
eventIdstringThe unique identifier of the event.
aggregateIdstringThe aggregate identifier associated with the event.
eventTypestringThe type of event.
timestampDateTimeThe timestamp when the event was written.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task
A task representing the asynchronous tracking operation.