Class RemotePromiseStore

Promise Store API

Implements

Constructors

Properties

Methods

Constructors

Properties

Methods

  • Cancels a new promise.

    Parameters

    • id: string

      Unique identifier for the promise.

    • ikey: undefined | string

      Idempotency key associated with the create operation.

    • strict: boolean

      If true, deduplicates only if the promise is canceled.

    • headers: undefined | Record<string, string>

      Key value pairs associated with the data.

    • data: undefined | string

      Encoded data of type string.

    Returns Promise<DurablePromiseRecord>

    A durable promise that is canceled, resolved, or rejected.

  • Creates a new durable promise

    Parameters

    • id: string

      Unique identifier for the promise.

    • ikey: undefined | string

      Idempotency key associated with the create operation.

    • strict: boolean

      If true, deduplicates only if the promise is pending.

    • headers: undefined | Record<string, string>

      Key value pairs associated with the data.

    • data: undefined | string

      Encoded data of type string.

    • timeout: number

      Time (in milliseconds) after which the promise is considered expired.

    • tags: undefined | Record<string, string>

      Key value pairs associated with the promise.

    Returns Promise<DurablePromiseRecord>

    A durable promise that is pending, canceled, resolved, or rejected.

  • Retrieves a promise based on its id.

    Parameters

    • id: string

      Unique identifier for the promise to be retrieved.

    Returns Promise<DurablePromiseRecord>

    A durable promise that is pending, canceled, resolved, or rejected.

  • Rejects a promise

    Parameters

    • id: string

      Unique identifier for the promise to be rejected.

    • ikey: undefined | string

      Integration key associated with the promise.

    • strict: boolean

      If true, deduplicates only if the promise is rejected.

    • headers: undefined | Record<string, string>

      Key value pairs associated with the data.

    • data: undefined | string

      Encoded data of type string.

    Returns Promise<DurablePromiseRecord>

    A durable promise that is canceled, resolved, or rejected.

  • Resolves a promise.

    Parameters

    • id: string

      Unique identifier for the promise to be resolved.

    • ikey: undefined | string

      Idempotency key associated with the resolve promise.

    • strict: boolean

      If true, deduplicates only if the promise is resolved.

    • headers: undefined | Record<string, string>

      Key value pairs associated with the data.

    • data: undefined | string

      Encoded data of type string.

    Returns Promise<DurablePromiseRecord>

    A durable promise that is canceled, resolved, or rejected.

  • Search for promises.

    Parameters

    • id: string

      Ids to match, can include wildcards.

    • state: undefined | string

      State to match.

    • tags: undefined | Record<string, string>

      Tags to match.

    • limit: undefined | number

      Maximum number of promises to return.

    Returns AsyncGenerator<DurablePromiseRecord[], void, unknown>

    A list of Durable Promises.