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

main
ts 32 lines 1.04 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 { JobQueue } from "./JobQueue.ts";
5
6 export interface CancelJobRequest extends batch.CancelJobRequest {}
7
8 /**
9 * Cancel a queued AWS Batch job from runtime code. Jobs in `SUBMITTED`,
10 * `PENDING`, or `RUNNABLE` state are cancelled; jobs that already progressed
11 * to `STARTING`/`RUNNING` are NOT cancelled (use `TerminateJob` for those) —
12 * the request still succeeds.
13 *
14 * ### Cancelling Jobs
15 * **Example:** Cancel a queued job
16 * ```typescript
17 * const cancelJob = yield* Batch.CancelJob(queue);
18 * yield* cancelJob({ jobId, reason: "superseded" });
19 * ```
20 *
21 * @binding
22 */
23 export interface CancelJob extends Binding.Service<
24 CancelJob,
25 "AWS.Batch.CancelJob",
26 (
27 queue: JobQueue,
28 ) => Effect.Effect<
29 (request: CancelJobRequest) => Effect.Effect<batch.CancelJobResponse, batch.CancelJobError>
30 >
31 > {}
32 export const CancelJob = Binding.Service<CancelJob>("AWS.Batch.CancelJob");