@adcp/sdk API Reference - v14.3.0
    Preparing search index...

    Interface DeferredTaskStorage

    Durable deferred-task storage must generation-fence claim and cleanup. Implementations MUST round-trip every DeferredTaskState field opaquely; dropping an unknown route-kind or ownership field can strand an in-flight mutation during a rolling SDK deployment.

    interface DeferredTaskStorage {
        get(key: string): Promise<DeferredTaskState | undefined>;
        set(key: string, value: DeferredTaskState, ttl?: number): Promise<void>;
        delete(key: string): Promise<void>;
        has(key: string): Promise<boolean>;
        clear?(): Promise<void>;
        keys?(): Promise<string[]>;
        size?(): Promise<number>;
        putIfAbsent(
            key: string,
            value: DeferredTaskState,
            ttl?: number,
        ): Promise<boolean>;
        replaceIfVersion(
            key: string,
            expectedVersion: string,
            value: DeferredTaskState,
            ttl?: number,
        ): Promise<boolean>;
        takeIfVersion(
            key: string,
            expectedVersion: string,
        ): Promise<DeferredTaskState | undefined>;
        putForSettlementOperationIfAbsent(
            operationId: string,
            key: string,
            value: DeferredTaskState,
            ttl?: number,
        ): Promise<boolean>;
        getBySettlementOperationId(
            operationId: string,
        ): Promise<{ token: string; state: DeferredTaskState } | undefined>;
        replaceForSettlementOperationIfVersion(
            operationId: string,
            currentKey: string,
            expectedVersion: string,
            replacementKey: string,
            replacementValue: DeferredTaskState,
            ttl?: number,
        ): Promise<boolean>;
    }

    Hierarchy (View Summary)

    Index
    • Atomically replace only the exact record generation currently stored.

      Parameters

      Returns Promise<boolean>

    • Atomically create a committed continuation and its operation route. The route is the crash-recovery source of truth when the owning coordinator has not yet recorded the opaque token.

      Parameters

      Returns Promise<boolean>

    • Atomically resolve the current committed continuation generation.

      Parameters

      • operationId: string

      Returns Promise<{ token: string; state: DeferredTaskState } | undefined>

    • Atomically replace the exact routed generation. With a distinct replacement key this installs a nested generation and moves the route, retaining the predecessor as a dispatch fence. Removing that predecessor MUST NOT remove a route that already points at the replacement. With the same key it performs an in-place route-fenced state transition (for example, terminal callback checkpointing).

      Parameters

      • operationId: string
      • currentKey: string
      • expectedVersion: string
      • replacementKey: string
      • replacementValue: DeferredTaskState
      • Optionalttl: number

      Returns Promise<boolean>