interface IDurableObjectStorage
Since 0.2.0

The subset of DurableObjectStorage the lock object uses.

Persisted rather than in-memory because a Durable Object is evicted after 70–140 seconds of inactivity when it cannot hibernate, and a lock TTL routinely outlives that — a deadline held in a field would evaporate and hand the same lock to a second holder.

Methods

get<T>(key: string): Promise<T | undefined>

Reads one persisted value.

put<T>(
key: string,
value: T
): Promise<void>

Writes one value.

delete(key: string): Promise<boolean>

Removes one value.

Usage

import { type IDurableObjectStorage } from "cloudflare-plugin/src/index.ts";