@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 42 lines 1.28 KB
Raw
1 import type * as batch from "@distilled.cloud/aws/batch";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { JobDefinition } from "./JobDefinition.ts";
5 import type { JobQueue } from "./JobQueue.ts";
6
7 /**
8 * The queue and job definition are injected by the binding; everything else
9 * (name, parameters, container overrides, ...) is the raw distilled request.
10 */
11 export interface SubmitJobRequest extends Omit<
12 batch.SubmitJobRequest,
13 "jobQueue" | "jobDefinition"
14 > {}
15
16 /**
17 * Submit a job to an AWS Batch job queue against a bound job definition —
18 * fire-and-forget heavy work from a Lambda or Task.
19 *
20 * ### Submitting Jobs
21 * **Example:** Submit from a Lambda
22 * ```typescript
23 * const submitJob = yield* Batch.SubmitJob(queue, jobDef);
24 * const { jobId } = yield* submitJob({
25 * jobName: "nightly-export",
26 * containerOverrides: { command: ["echo", "hello"] },
27 * });
28 * ```
29 *
30 * @binding
31 */
32 export interface SubmitJob extends Binding.Service<
33 SubmitJob,
34 "AWS.Batch.SubmitJob",
35 (
36 queue: JobQueue,
37 jobDefinition: JobDefinition,
38 ) => Effect.Effect<
39 (request: SubmitJobRequest) => Effect.Effect<batch.SubmitJobResponse, batch.SubmitJobError>
40 >
41 > {}
42 export const SubmitJob = Binding.Service<SubmitJob>("AWS.Batch.SubmitJob");