Interface IPersistDictionaryInstance

Per-context dictionary persistence instance interface. Scoped to a specific (signalId, dictionaryName) pair.

Used by DictionaryPersistInstance for crash-safe per-signal dictionary storage. Custom adapters should implement this interface to override the default file-based dictionary behavior.

interface IPersistDictionaryInstance {
    dispose(): void;
    readDictionaryData(): Promise<DictionaryData>;
    waitForInit(initial: boolean): Promise<void>;
    writeDictionaryData(data: DictionaryData, when: Date): Promise<void>;
}

Implemented by

Methods

  • Release any resources held by this instance. Default implementations may treat this as a no-op.

    Returns void

  • Initialize storage for this dictionary context.

    Parameters

    • initial: boolean

      Whether this is the first initialization

    Returns Promise<void>

    Promise that resolves when initialization is complete

  • Write dictionary snapshot for this context.

    Parameters

    • data: DictionaryData

      Dictionary data to persist (already carries data.when)

    • when: Date

      Logical timestamp this value belongs to (duplicates data.when for API consistency)

    Returns Promise<void>

    Promise that resolves when write is complete