@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 39 lines 1.19 KB
Raw
1 import type * as deadline from "@distilled.cloud/aws/deadline";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Queue } from "./Queue.ts";
5
6 /**
7 * Runtime binding for `deadline:GetJob`.
8 *
9 * Reads a job's detail in the bound {@link Queue} — lifecycle status, task
10 * run status counts, priority, timing. The queue's `farmId`/`queueId` are
11 * injected from the binding. Provide the implementation with
12 * `Effect.provide(AWS.Deadline.GetJobHttp)`.
13 * ### Monitoring Jobs
14 * **Example:** Check A Job's Status
15 * ```typescript
16 * // init — bind the operation to the queue
17 * const getJob = yield* AWS.Deadline.GetJob(queue);
18 *
19 * // runtime
20 * const job = yield* getJob({ jobId });
21 * if (job.taskRunStatus === "FAILED") {
22 * yield* Effect.logError(job.lifecycleStatusMessage);
23 * }
24 * ```
25 *
26 * @binding
27 */
28 export interface GetJob extends Binding.Service<
29 GetJob,
30 "AWS.Deadline.GetJob",
31 (
32 queue: Queue,
33 ) => Effect.Effect<
34 (
35 request: Omit<deadline.GetJobRequest, "farmId" | "queueId">,
36 ) => Effect.Effect<deadline.GetJobResponse, deadline.GetJobError>
37 >
38 > {}
39 export const GetJob = Binding.Service<GetJob>("AWS.Deadline.GetJob");