Interface IPersistNotificationInstance

Per-context notification persistence instance interface. Scoped to either backtest or live mode (one instance per mode).

Each notification is keyed by its id and the read operation iterates over all stored notifications.

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

interface IPersistNotificationInstance {
    readNotificationData(): Promise<NotificationData>;
    waitForInit(initial: boolean): Promise<void>;
    writeNotificationData(notifications: NotificationData): Promise<void>;
}

Implemented by

Methods

  • Initialize storage for this mode.

    Parameters

    • initial: boolean

      Whether this is the first initialization

    Returns Promise<void>

    Promise that resolves when initialization is complete

  • Write notifications to storage. Each notification is keyed by its id.

    Parameters

    Returns Promise<void>

    Promise that resolves when all writes are complete