| 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:ListSessions`. |
| 8 | * |
| 9 | * Enumerates the worker sessions of a job in the bound {@link Queue} |
| 10 | * (paginated). The queue's `farmId`/`queueId` are injected from the |
| 11 | * binding. Provide the implementation with |
| 12 | * `Effect.provide(AWS.Deadline.ListSessionsHttp)`. |
| 13 | * ### Monitoring Sessions |
| 14 | * **Example:** List A Job's Sessions |
| 15 | * ```typescript |
| 16 | * // init — bind the operation to the queue |
| 17 | * const listSessions = yield* AWS.Deadline.ListSessions(queue); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { sessions } = yield* listSessions({ jobId }); |
| 21 | * ``` |
| 22 | * |
| 23 | * @binding |
| 24 | */ |
| 25 | export interface ListSessions extends Binding.Service< |
| 26 | ListSessions, |
| 27 | "AWS.Deadline.ListSessions", |
| 28 | ( |
| 29 | queue: Queue, |
| 30 | ) => Effect.Effect< |
| 31 | ( |
| 32 | request: Omit<deadline.ListSessionsRequest, "farmId" | "queueId">, |
| 33 | ) => Effect.Effect< |
| 34 | deadline.ListSessionsResponse, |
| 35 | deadline.ListSessionsError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | export const ListSessions = Binding.Service<ListSessions>( |
| 40 | "AWS.Deadline.ListSessions", |
| 41 | ); |