Table of Contents

Interface IProjectionStore<TState>

Namespace
Opossum.Projections
Assembly
Opossum.dll

Storage interface for reading projection state

public interface IProjectionStore<TState> where TState : class

Type Parameters

TState

The projection state type

Methods

DeleteAsync(string, CancellationToken)

Deletes a projection instance (internal use by ProjectionManager)

Task DeleteAsync(string key, CancellationToken cancellationToken = default)

Parameters

key string
cancellationToken CancellationToken

Returns

Task

GetAllAsync(CancellationToken)

Retrieves all projection instances

Task<IReadOnlyList<TState>> GetAllAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation 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

key string

The projection instance key

cancellationToken CancellationToken

Cancellation 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

predicate Func<TState, bool>

Filter predicate

cancellationToken CancellationToken

Cancellation 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

tag Tag

The tag to query (case-insensitive comparison)

cancellationToken CancellationToken

Cancellation 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

tags IEnumerable<Tag>

The tags to query (all must match, case-insensitive comparison)

cancellationToken CancellationToken

Cancellation 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

key string
state TState
cancellationToken CancellationToken

Returns

Task