Interface IPersistLogInstance

Global log entry persistence instance interface. Unlike other Persist instances, log storage has no context — there is a single global instance per process.

Each log entry is keyed by its id and the read operation iterates over all stored entries.

Custom adapters should implement this interface to override the default file-based log storage behavior.

interface IPersistLogInstance {
    readLogData(): Promise<LogData>;
    waitForInit(initial: boolean): Promise<void>;
    writeLogData(entries: LogData): Promise<void>;
}

Implemented by

Methods

  • Read all persisted log entries by iterating storage keys.

    Returns Promise<LogData>

    Promise resolving to array of log entries

  • Initialize the global log storage.

    Parameters

    • initial: boolean

      Whether this is the first initialization

    Returns Promise<void>

    Promise that resolves when initialization is complete

  • Write log entries to storage. Each entry is keyed by its id. Implementations should skip entries whose id already exists to keep the log append-only.

    Parameters

    • entries: LogData

      Log entries to persist

    Returns Promise<void>

    Promise that resolves when all writes are complete