@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, 04:45 UTC

main
ts 40 lines 1.3 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 /** The queue is injected by the binding; the request carries nothing else. */
7 export interface GetJobQueueSnapshotRequest extends Omit<
8 batch.GetJobQueueSnapshotRequest,
9 "jobQueue"
10 > {}
11
12 /**
13 * Snapshot the head of the bound AWS Batch job queue (the next ~100 `RUNNABLE`
14 * jobs the scheduler will run, in dispatch order) — queue introspection for
15 * dashboards and backpressure decisions from runtime code.
16 *
17 * ### Inspecting the Queue
18 * **Example:** Read the front of the queue
19 * ```typescript
20 * const getJobQueueSnapshot = yield* Batch.GetJobQueueSnapshot(queue);
21 * const { frontOfQueue } = yield* getJobQueueSnapshot();
22 * const next = frontOfQueue?.jobs?.[0]?.jobArn;
23 * ```
24 *
25 * @binding
26 */
27 export interface GetJobQueueSnapshot extends Binding.Service<
28 GetJobQueueSnapshot,
29 "AWS.Batch.GetJobQueueSnapshot",
30 (
31 queue: JobQueue,
32 ) => Effect.Effect<
33 (
34 request?: GetJobQueueSnapshotRequest,
35 ) => Effect.Effect<batch.GetJobQueueSnapshotResponse, batch.GetJobQueueSnapshotError>
36 >
37 > {}
38 export const GetJobQueueSnapshot = Binding.Service<GetJobQueueSnapshot>(
39 "AWS.Batch.GetJobQueueSnapshot",
40 );