Class SessionStore
SQLite-backed session store. Handles all CRUD against ~/.jdai/sessions.db.
public sealed class SessionStore : IDisposable
- Inheritance
-
SessionStore
- Implements
- Inherited Members
Constructors
SessionStore(string?)
public SessionStore(string? dbPath = null)
Parameters
dbPathstring
Methods
CloseInactiveSessionsAsync(TimeSpan)
Closes all active sessions that have been inactive for longer than maxInactiveAge.
Returns the count of sessions closed.
public Task<int> CloseInactiveSessionsAsync(TimeSpan maxInactiveAge)
Parameters
maxInactiveAgeTimeSpan
Returns
CloseSessionAsync(string)
public Task CloseSessionAsync(string id)
Parameters
idstring
Returns
CreateSessionAsync(SessionInfo)
public Task CreateSessionAsync(SessionInfo session)
Parameters
sessionSessionInfo
Returns
DeleteTurnsAfterAsync(string, int)
public Task DeleteTurnsAfterAsync(string sessionId, int turnIndex)
Parameters
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetSessionAsync(string)
public Task<SessionInfo?> GetSessionAsync(string id)
Parameters
idstring
Returns
InitializeAsync()
Create tables if they don't exist.
public Task InitializeAsync()
Returns
ListSessionsAsync(string?, int)
public Task<ReadOnlyCollection<SessionInfo>> ListSessionsAsync(string? projectHash = null, int limit = 20)
Parameters
Returns
SaveTurnAsync(TurnRecord)
public Task SaveTurnAsync(TurnRecord turn)
Parameters
turnTurnRecord
Returns
UpdateSessionAsync(SessionInfo)
public Task UpdateSessionAsync(SessionInfo session)
Parameters
sessionSessionInfo