annotations-design-patterns
    Preparing search index...

    Interface AtomicAsyncStore<K, V>

    An async store with a verified per-key update primitive. Calling get and then set on a plain AsyncStore is not an atomic compare-and-set operation.

    interface AtomicAsyncStore<K, V> {
        get(key: K): Promise<V | undefined>;
        has(key: K): Promise<boolean>;
        set(key: K, value: V, options?: StoreEntryOptions): Promise<void>;
        delete(key: K): Promise<boolean>;
        clear(): Promise<void>;
        capabilities: StoreCapabilities & { atomic: true };
        update(
            key: K,
            updater: AsyncStoreUpdater<V>,
            options?: StoreEntryOptions,
        ): Promise<V>;
    }

    Type Parameters

    • K
    • V

    Hierarchy (View Summary)

    Implemented by

    Index
    capabilities: StoreCapabilities & { atomic: true }