Class RedbBatchStore

Assembly: redb.Route.Llm.dll

REDB-backed . One row
per submitted batch; the batch id lives in _objects.value_string
(partial index on PostgreSQL/SQLite; MSSQL cannot index NVARCHAR(MAX)) and,
normalized, in _objects._value_unique — the per-scheme unique index
keeps a batch raced between the submit path and a fast webhook callback on
a single row.

The store does not own an instance — each call
resolves one through IRouteContext.GetRedbService(name, exchange),
which honours the per-exchange scope cache. The redb name is read from
exchange.Properties[LlmKeys.RedbName] (set by the LLM endpoint URI),
falling back to the constructor-supplied default name and then to the host's
default unnamed instance.

public sealed class RedbBatchStore : IBatchStore

Inheritance

Object→RedbBatchStore

Implements

Methods

GetAsync(string, IExchange?, CancellationToken)

Loads a previously-registered batch by id; null if unknown.

public Task<BatchJobRecord?> GetAsync(string batchId, IExchange? exchange = null, CancellationToken ct = default)

RegisterAsync(BatchJobRecord, IExchange?, CancellationToken)

Records a batch submission. Replaces an existing row with the same id.

public Task RegisterAsync(BatchJobRecord record, IExchange? exchange = null, CancellationToken ct = default)

RegisterManyAsync(IEnumerable<BatchJobRecord>, IExchange?, CancellationToken)

Records many batch submissions at once. Bulk-friendly stores commit the

public Task RegisterManyAsync(IEnumerable<BatchJobRecord> records, IExchange? exchange = null, CancellationToken ct = default)

UpdateStatusAsync(string, string, DateTimeOffset?, string?, IExchange?, CancellationToken)

Updates lifecycle status and optional fields. Unknown ids are ignored

public Task UpdateStatusAsync(string batchId, string status, DateTimeOffset? completedAtUtc = null, string? errorMessage = null, IExchange? exchange = null, CancellationToken ct = default)

Constructors

RedbBatchStore(IRouteContext, string?)

Creates the store. Scheme is synced by the host's redb.InitializeAsync().