(
id: string,
options: WorkspaceRuntimeGetOptions<E> = {},
)
| 94 | options: WorkspaceRuntimeGetOptions<undefined>, |
| 95 | ): Promise<WorkspaceRuntimeExecHandle<undefined>>; |
| 96 | async getExec<E extends ExecEncoding>( |
| 97 | id: string, |
| 98 | options: WorkspaceRuntimeGetOptions<E> = {}, |
| 99 | ): Promise<WorkspaceRuntimeExecHandle<E>> { |
| 100 | assertExecutionId(id); |
| 101 | const backend = this.#backend(options.backend); |
| 102 | if (this.#options.commandBackendIds.has(backend)) { |
| 103 | const shell = this.#options.shell(); |
| 104 | const handle = await ( |
| 105 | shell.get as unknown as ( |
| 106 | id: string, |
| 107 | options: Record<string, unknown>, |
| 108 | ) => Promise<ExecHandle<E>> |
| 109 | )(id, { |
| 110 | backend, |
| 111 | encoding: options.encoding, |
| 112 | resume: options.resume, |
| 113 | }); |
| 114 | const resultHandle = |
| 115 | options.resume === undefined || options.resume === "full" |
| 116 | ? undefined |
| 117 | : () => |
| 118 | ( |
| 119 | shell.get as unknown as ( |
| 120 | id: string, |
| 121 | options: Record<string, unknown>, |
| 122 | ) => Promise<ExecHandle<E>> |
| 123 | )(id, { |
| 124 | backend, |
| 125 | encoding: options.encoding, |
| 126 | resume: "full", |
| 127 | }); |
| 128 | return wrapCommandHandle(handle, backend, resultHandle); |
| 129 | } |
| 130 | |
| 131 | const runtime = await this.#options.moduleHandle(backend); |
| 132 | const envelope = await runtime.getExec({ id, after: resumeToAfter(options.resume) }); |
| 133 | return wrapModuleHandle( |
| 134 | runtime, |
| 135 | backend, |
| 136 | envelope.id, |
| 137 | envelope.events, |
| 138 | options.encoding, |
| 139 | options.resume === undefined || options.resume === "full", |
| 140 | ); |
| 141 | } |
| 142 | |
| 143 | async killExec(id: string, options: WorkspaceRuntimeKillOptions = {}): Promise<void> { |
| 144 | assertExecutionId(id); |
nothing calls this directly
no test coverage detected