Table of Contents

Class InMemoryExitSessionStorage

Namespace
NArk.Core.Exit
Assembly
NArk.Core.dll

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

walletId string
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<ExitSession>>

GetByIdAsync(string, CancellationToken)

public Task<ExitSession?> GetByIdAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string
cancellationToken CancellationToken

Returns

Task<ExitSession>

GetByStateAsync(ExitSessionState, CancellationToken)

public Task<IReadOnlyList<ExitSession>> GetByStateAsync(ExitSessionState state, CancellationToken cancellationToken = default)

Parameters

state ExitSessionState
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<ExitSession>>

GetByVtxoAsync(OutPoint, CancellationToken)

public Task<ExitSession?> GetByVtxoAsync(OutPoint vtxoOutpoint, CancellationToken cancellationToken = default)

Parameters

vtxoOutpoint OutPoint
cancellationToken CancellationToken

Returns

Task<ExitSession>

UpsertAsync(ExitSession, CancellationToken)

public Task UpsertAsync(ExitSession session, CancellationToken cancellationToken = default)

Parameters

session ExitSession
cancellationToken CancellationToken

Returns

Task