Interface IProjectionStore<TState>
- Namespace
- Opossum.Projections
- Assembly
- Opossum.dll
Storage interface for reading projection state
public interface IProjectionStore<TState> where TState : class
Type Parameters
TStateThe projection state type
Methods
DeleteAsync(string, CancellationToken)
Deletes a projection instance (internal use by ProjectionManager)
Task DeleteAsync(string key, CancellationToken cancellationToken = default)
Parameters
keystringcancellationTokenCancellationToken
Returns
GetAllAsync(CancellationToken)
Retrieves all projection instances
Task<IReadOnlyList<TState>> GetAllAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token
Returns
- Task<IReadOnlyList<TState>>
List of all projection instances
GetAsync(string, CancellationToken)
Retrieves a single projection instance by key
Task<TState?> GetAsync(string key, CancellationToken cancellationToken = default)
Parameters
keystringThe projection instance key
cancellationTokenCancellationTokenCancellation token
Returns
- Task<TState>
The projection state, or null if not found
QueryAsync(Func<TState, bool>, CancellationToken)
Queries projection instances with a predicate filter
Task<IReadOnlyList<TState>> QueryAsync(Func<TState, bool> predicate, CancellationToken cancellationToken = default)
Parameters
predicateFunc<TState, bool>Filter predicate
cancellationTokenCancellationTokenCancellation token
Returns
- Task<IReadOnlyList<TState>>
Filtered list of projection instances
QueryByTagAsync(Tag, CancellationToken)
Queries projection instances by a single tag using the tag index. Much more efficient than GetAllAsync when projections have tag providers configured. Returns empty list if tag index doesn't exist.
Task<IReadOnlyList<TState>> QueryByTagAsync(Tag tag, CancellationToken cancellationToken = default)
Parameters
tagTagThe tag to query (case-insensitive comparison)
cancellationTokenCancellationTokenCancellation token
Returns
- Task<IReadOnlyList<TState>>
List of projection instances matching the tag
QueryByTagsAsync(IEnumerable<Tag>, CancellationToken)
Queries projection instances by multiple tags using tag indices (AND logic). Returns only projections that match ALL specified tags. Much more efficient than GetAllAsync when projections have tag providers configured. Returns empty list if any tag index doesn't exist.
Task<IReadOnlyList<TState>> QueryByTagsAsync(IEnumerable<Tag> tags, CancellationToken cancellationToken = default)
Parameters
tagsIEnumerable<Tag>The tags to query (all must match, case-insensitive comparison)
cancellationTokenCancellationTokenCancellation token
Returns
- Task<IReadOnlyList<TState>>
List of projection instances matching all tags
SaveAsync(string, TState, CancellationToken)
Saves or updates a projection instance (internal use by ProjectionManager)
Task SaveAsync(string key, TState state, CancellationToken cancellationToken = default)
Parameters
keystringstateTStatecancellationTokenCancellationToken