Activity Context, used to:
- Get Info about the current Activity Execution
- Send heartbeats
- Get notified of Activity cancellation
- Sleep (cancellation-aware)
Context.current() from Activity code in order to get the current Activity's Context.
AbortSignal that can be used to react to
Await this promise in an Activity to get notified of cancellation.
This promise will never resolve—it will only be rejected with a CancelledFailure.
Holds information about the current executing Activity.
Send a heartbeat from an Activity.
If an Activity times out, then during the next retry, the last value of
details is available at
heartbeatDetails. This acts as a periodic checkpoint mechanism for the progress of an Activity.
If an Activity times out on the final retry (relevant in cases in which RetryPolicy.maximumAttempts is
set), the Activity function call in the Workflow code will throw an ActivityFailure with the
attribute set to a TimeoutFailure, which has the last value of
details available at
heartbeat() from a Local Activity has no effect.
Activities must heartbeat in order to receive Cancellation (unless they're Local Activities, which don't need to).
Helper function for sleeping in an Activity.
|Sleep duration: number of milliseconds or ms-formatted string|
A Promise that either resolves when
ms is reached or rejects when the Activity is cancelled
Gets the context of the current Activity.
Uses AsyncLocalStorage under the hood to make it accessible in nested callbacks and promises.