nestjs-temporal-core
    Preparing search index...

    Interface ActivityHandle<R>Experimental

    Handle that can be used to perform operations on the associated Activity. Can be obtained by calling ActivityClient.start or ActivityClient.getHandle.

    interface ActivityHandle<R = any> {
        activityId: string;
        runId?: string;
        cancel(reason: string): Promise<void>;
        describe(): Promise<ActivityExecutionDescription>;
        result(): Promise<R>;
        terminate(reason: string): Promise<void>;
    }

    Type Parameters

    • R = any

      Result type of the activity. Use ActivityClient.typed to start activities in a type-safe way.

      Standalone Activities are experimental. APIs may be subject to change.

    Index
    activityId: string

    ID of the Activity this handle refers to.

    runId?: string

    Run ID of the specific Activity execution this handle refers to. If empty, this handle refers to the latest execution of the Activity with given ID.

    • Experimental

      Requests cancellation of the Activity execution. Note that cancellations are cooperative and not guaranteed to happen.

      Parameters

      • reason: string

      Returns Promise<void>

    • Experimental

      Returns information about the Activity execution.

      Returns Promise<ActivityExecutionDescription>

    • Experimental

      Waits until the activity completes. If the activity is successful, returns the result of the activity. If the activity was not successful, throws ActivityExecutionFailedError. The activity failure is stored in the cause field.

      Returns Promise<R>

    • Experimental

      Terminates the Activity execution. Note that the worker is not immediately notified of termination and may continue running the activity.

      Parameters

      • reason: string

      Returns Promise<void>