PersistIntervalInstance

Implements IPersistIntervalInstance

Default file-based implementation of IPersistIntervalInstance.

Features:

  • Wraps PersistBase for atomic JSON writes
  • Soft delete via removed: true flag
  • listIntervalData filters out removed markers
constructor(bucket: string);
bucket: string
_storage: any

Underlying file-based storage for this bucket

waitForInit(initial: boolean): Promise<void>;

Initializes the underlying PersistBase storage.

readIntervalData(key: string): Promise<IntervalData | null>;

Reads an interval marker by key. Returns null if marker is missing or soft-deleted.

writeIntervalData(data: IntervalData, key: string): Promise<void>;

Writes an interval marker under the given key.

removeIntervalData(key: string): Promise<void>;

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

listIntervalData(): AsyncGenerator<string>;

Iterates all markers in the bucket, yielding keys of non-removed markers only.