Skip to content

FileStorage

Defined in: storage/file.ts:16

File-based storage implementation

T extends QueueItem = QueueItem

new FileStorage<T>(filePath): FileStorage<T>

Defined in: storage/file.ts:17

string

FileStorage<T>

acquireLock(holder, ttlMs): Promise<boolean>

Defined in: storage/file.ts:44

Acquire a distributed lock

string

Identifier for the lock holder

number

Time-to-live in milliseconds

Promise<boolean>

true if lock acquired, false if already locked

QueueStorage.acquireLock


getLock(): Promise<QueueLock | null>

Defined in: storage/file.ts:79

Get the current lock info

Promise<QueueLock | null>

QueueStorage.getLock


isLocked(): Promise<boolean>

Defined in: storage/file.ts:73

Check if a lock is currently held

Promise<boolean>

QueueStorage.isLocked


read(): Promise<QueueState<T>>

Defined in: storage/file.ts:19

Read the current queue state

Promise<QueueState<T>>

QueueStorage.read


releaseLock(holder): Promise<void>

Defined in: storage/file.ts:64

Release a distributed lock

string

Must match the holder that acquired the lock

Promise<void>

QueueStorage.releaseLock


write(state): Promise<void>

Defined in: storage/file.ts:32

Write the queue state

QueueState<T>

Promise<void>

QueueStorage.write