InMemoryRunInputStore
AgentPrism.Core.dllThe default store that keeps run inputs in memory.
public sealed class InMemoryRunInputStore : IRunInputStoreInheritance
Section titled “Inheritance”object ← InMemoryRunInputStore
Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”The in-memory implementation is first class. Replay works in a deployment without a SQL provider. Records live for the process lifetime, and the oldest record is removed when InMemoryRunInputStore.MaxRuns is exceeded.
Messages are stored as objects here. Serialization occurs only in the SQL implementation, so polymorphic content is never lost on the in-memory path.
Constructors
Section titled “Constructors”InMemoryRunInputStore()
Section titled “ InMemoryRunInputStore()”public InMemoryRunInputStore()Properties
Section titled “Properties”MaxRuns
Section titled “ MaxRuns”The maximum number of inputs to keep in memory. The oldest input is removed when this limit is exceeded.
public int MaxRuns { get; init; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”GetAsync(string, Guid, CancellationToken)
Section titled “ GetAsync(string, Guid, CancellationToken)”Reads the stored input.
public ValueTask<RunInputRecord?> GetAsync(string tenantId, Guid runId, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant identifier.
runId Guid
The run identifier.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The record; null if it does not exist or belongs to another tenant.
SaveAsync(RunInputRecord, CancellationToken)
Section titled “ SaveAsync(RunInputRecord, CancellationToken)”Saves the input messages.
public ValueTask SaveAsync(RunInputRecord record, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”record RunInputRecord
The input to save.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The completion task.
Remarks
Section titled “Remarks”A second write for the same run is ignored: a queued run can start twice with the same identifier, and the input must not change.