Class InMemoryExitSessionStorage
In-process IExitSessionStorage with no durable backing store. State lives for the lifetime of the host — perfect for emergency-exit tooling, plugins, or ephemeral wallets that don't want the EF Core schema cost. If the host restarts mid-exit, the session is lost and the consumer has to re-trigger; trade off resumability for zero persistence.
public class InMemoryExitSessionStorage : IExitSessionStorage
- Inheritance
-
InMemoryExitSessionStorage
- Implements
- Inherited Members
Remarks
Within a process this storage is fully compatible with the existing
UnilateralExitService / ExitWatchtowerService flow — same
code paths, just no SQL.
Methods
GetActiveSessionsAsync(string?, CancellationToken)
Returns all sessions not yet completed or failed, optionally filtered by wallet ID.
public Task<IReadOnlyList<ExitSession>> GetActiveSessionsAsync(string? walletId = null, CancellationToken cancellationToken = default)
Parameters
walletIdstringcancellationTokenCancellationToken
Returns
GetByIdAsync(string, CancellationToken)
public Task<ExitSession?> GetByIdAsync(string id, CancellationToken cancellationToken = default)
Parameters
idstringcancellationTokenCancellationToken
Returns
GetByStateAsync(ExitSessionState, CancellationToken)
public Task<IReadOnlyList<ExitSession>> GetByStateAsync(ExitSessionState state, CancellationToken cancellationToken = default)
Parameters
stateExitSessionStatecancellationTokenCancellationToken
Returns
GetByVtxoAsync(OutPoint, CancellationToken)
public Task<ExitSession?> GetByVtxoAsync(OutPoint vtxoOutpoint, CancellationToken cancellationToken = default)
Parameters
vtxoOutpointOutPointcancellationTokenCancellationToken
Returns
UpsertAsync(ExitSession, CancellationToken)
public Task UpsertAsync(ExitSession session, CancellationToken cancellationToken = default)
Parameters
sessionExitSessioncancellationTokenCancellationToken