Table of Contents

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

projectionType string

The type of projection to check.

cancellationToken CancellationToken

The 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

expectedProcessingTime TimeSpan

The expected maximum processing time.

maxResults int

Maximum number of results to return.

cancellationToken CancellationToken

The 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

eventId string

The event identifier to check.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<bool>

True if the event has been fully processed; otherwise, false.

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

eventId string

The event identifier that triggered the projection update.

projectionType string

The type of projection updated.

timestamp DateTime

The timestamp when the projection was updated.

cancellationToken CancellationToken

The 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

eventId string

The unique identifier of the event.

aggregateId string

The aggregate identifier associated with the event.

eventType string

The type of event.

timestamp DateTime

The timestamp when the event was written.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A task representing the asynchronous tracking operation.