Table of Contents

Class InMemorySessionRepository

Namespace
JD.AI.Core.Sessions
Assembly
JD.AI.Core.dll

In-memory session repository for testing and lightweight deployments. Not suitable for production multi-node use.

public sealed class InMemorySessionRepository : ISessionRepository
Inheritance
InMemorySessionRepository
Implements
Inherited Members

Properties

Count

Number of stored sessions.

public int Count { get; }

Property Value

int

Methods

CountAsync(string?, CancellationToken)

Returns the total number of sessions.

public Task<long> CountAsync(string? projectPath = null, CancellationToken ct = default)

Parameters

projectPath string
ct CancellationToken

Returns

Task<long>

CreateSessionAsync(SessionRecord, CancellationToken)

Creates a new session record.

public Task CreateSessionAsync(SessionRecord session, CancellationToken ct = default)

Parameters

session SessionRecord
ct CancellationToken

Returns

Task

DeleteSessionAsync(string, CancellationToken)

Deletes a session and all its related data.

public Task DeleteSessionAsync(string sessionId, CancellationToken ct = default)

Parameters

sessionId string
ct CancellationToken

Returns

Task

GetSessionAsync(string, CancellationToken)

Gets a session by ID.

public Task<SessionRecord?> GetSessionAsync(string sessionId, CancellationToken ct = default)

Parameters

sessionId string
ct CancellationToken

Returns

Task<SessionRecord>

ListSessionsAsync(string?, int, int, CancellationToken)

Lists sessions with optional filtering.

public Task<IReadOnlyList<SessionRecord>> ListSessionsAsync(string? projectPath = null, int limit = 50, int offset = 0, CancellationToken ct = default)

Parameters

projectPath string
limit int
offset int
ct CancellationToken

Returns

Task<IReadOnlyList<SessionRecord>>

UpdateSessionAsync(SessionRecord, CancellationToken)

Updates an existing session record.

public Task UpdateSessionAsync(SessionRecord session, CancellationToken ct = default)

Parameters

session SessionRecord
ct CancellationToken

Returns

Task