Skip to content
Français

createTaskCacheStore

import { createTaskCacheStore } from "@elie-laloum/outpost";

Create a TaskCacheStore that keeps each entry as task-cache/<fingerprint>.json. A write replaces the stored entry conditionally and keeps a concurrent writer’s entry; a read validates the entry and rejects one above maxBytes. Entries are not authenticated: anyone who can write the transport controls restored results.

Complete example and detailed rules.

  • optionsRequired
    TaskCacheStoreOptions
    Transport that stores entries under task-cache/ and an optional entry size bound.
  • options.maxBytesOptional
    number | undefined
    Positive maximum serialized entry size in bytes, default 16 MiB; enforced when writing and reading.
  • options.transporterRequired
    Transport
    Caller-owned object transport used by the store or operation. Closing a workflow or sandbox does not close this transport.

TaskCacheStore

export declare function createTaskCacheStore(
  options: TaskCacheStoreOptions,
): TaskCacheStore;