| 1 | import type * as deadline from "@distilled.cloud/aws/deadline"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Queue } from "./Queue.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `deadline:GetTask`. |
| 8 | * |
| 9 | * Reads a task's detail for a step in the bound {@link Queue} — run status, |
| 10 | * parameters, retry count, latest session action. The queue's |
| 11 | * `farmId`/`queueId` are injected from the binding. Provide the |
| 12 | * implementation with `Effect.provide(AWS.Deadline.GetTaskHttp)`. |
| 13 | * ### Monitoring Tasks |
| 14 | * **Example:** Inspect A Task |
| 15 | * ```typescript |
| 16 | * // init — bind the operation to the queue |
| 17 | * const getTask = yield* AWS.Deadline.GetTask(queue); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const task = yield* getTask({ jobId, stepId, taskId }); |
| 21 | * ``` |
| 22 | * |
| 23 | * @binding |
| 24 | */ |
| 25 | export interface GetTask extends Binding.Service< |
| 26 | GetTask, |
| 27 | "AWS.Deadline.GetTask", |
| 28 | ( |
| 29 | queue: Queue, |
| 30 | ) => Effect.Effect< |
| 31 | ( |
| 32 | request: Omit<deadline.GetTaskRequest, "farmId" | "queueId">, |
| 33 | ) => Effect.Effect<deadline.GetTaskResponse, deadline.GetTaskError> |
| 34 | > |
| 35 | > {} |
| 36 | export const GetTask = Binding.Service<GetTask>("AWS.Deadline.GetTask"); |