| 1 | import type * as sfn from "@distilled.cloud/aws/sfn"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Activity } from "./Activity.ts"; |
| 5 | |
| 6 | export interface SendTaskHeartbeatRequest extends sfn.SendTaskHeartbeatInput {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `states:SendTaskHeartbeat`. |
| 10 | * |
| 11 | * Reports liveness for a long-running callback-pattern task |
| 12 | * (`.waitForTaskToken`) or {@link Activity} task so its |
| 13 | * `HeartbeatSeconds` timeout does not fire. Bind without arguments for |
| 14 | * task tokens issued by service-integration Task states, or pass an |
| 15 | * `Activity` to scope access. |
| 16 | * ### Callback Pattern |
| 17 | * **Example:** Keep a waiting task alive |
| 18 | * ```typescript |
| 19 | * const sendTaskHeartbeat = yield* StepFunctions.SendTaskHeartbeat(); |
| 20 | * |
| 21 | * yield* sendTaskHeartbeat({ taskToken: token }); |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface SendTaskHeartbeat extends Binding.Service< |
| 27 | SendTaskHeartbeat, |
| 28 | "AWS.StepFunctions.SendTaskHeartbeat", |
| 29 | ( |
| 30 | activity?: Activity, |
| 31 | ) => Effect.Effect< |
| 32 | ( |
| 33 | request: SendTaskHeartbeatRequest, |
| 34 | ) => Effect.Effect<sfn.SendTaskHeartbeatOutput, sfn.SendTaskHeartbeatError> |
| 35 | > |
| 36 | > {} |
| 37 | export const SendTaskHeartbeat = Binding.Service<SendTaskHeartbeat>( |
| 38 | "AWS.StepFunctions.SendTaskHeartbeat", |
| 39 | ); |