Class PersistIntervalInstance

Default file-based implementation of IPersistIntervalInstance.

Features:

  • Wraps PersistBase for atomic JSON writes
  • Soft delete via removed: true flag
  • listIntervalData filters out removed markers
const instance = new PersistIntervalInstance("my-interval-bucket");
await instance.waitForInit(true);
await instance.writeIntervalData({ id: "x", data: {}, removed: false }, "key1");
const marker = await instance.readIntervalData("key1");
await instance.removeIntervalData("key1");

Implements

Constructors

Properties

bucket: string

Methods

  • Soft-deletes a marker by writing removed: true flag while preserving the file. Subsequent reads will return null, allowing the interval to fire again.

    Parameters

    • key: string

      Marker key within the bucket

    Returns Promise<void>

    Promise that resolves when removal is complete

  • Initializes the underlying PersistBase storage.

    Parameters

    • initial: boolean

      Whether this is the first initialization

    Returns Promise<void>

    Promise that resolves when initialization is complete