UNPKG

@temporalio/common

Version:

Common library for code that's used across the Client, Worker, and/or Workflow

36 lines (35 loc) 1.42 kB
import type { ExternalStorage, StorageDriverTargetInfo } from '../converter/extstore'; import type { Payload } from '../interfaces'; /** @internal @experimental */ export interface ExternalStoreOptions { /** Identity of the workflow or activity that produced the payloads. */ target?: StorageDriverTargetInfo; /** Aborts the in-flight store operation. */ abortSignal?: AbortSignal; } /** @internal @experimental */ export interface ExternalRetrieveOptions { /** Aborts the in-flight retrieve operation. */ abortSignal?: AbortSignal; } /** * Drives External Storage operations against a configured {@link ExternalStorage}. * * @internal * @experimental */ export declare class ExternalStorageRunner { private readonly externalStorage; constructor(externalStorage: ExternalStorage); /** * Replace each payload above the configured size threshold with a reference payload. * Payloads below the threshold (or that the selector keeps inline) pass through * unchanged. Order is preserved. */ store(payloads: Payload[], options?: ExternalStoreOptions): Promise<Payload[]>; /** * Replace each reference payload in `payloads` with the payload bytes returned by the * named driver. Non-reference payloads are passed through unchanged. Order is preserved. */ retrieve(payloads: Payload[], options?: ExternalRetrieveOptions): Promise<Payload[]>; }