(id: number)
| 91 | }) |
| 92 | |
| 93 | const finishShell = (id: number) => |
| 94 | SynchronizedRef.modifyEffect( |
| 95 | ref, |
| 96 | Effect.fnUntraced(function* (st) { |
| 97 | if (st._tag === "Shell" && st.shell.id === id) { |
| 98 | return [idle, { _tag: "Idle" }] as const |
| 99 | } |
| 100 | if (st._tag === "ShellThenRun" && st.shell.id === id) { |
| 101 | const run = yield* startRun(st.run.work, st.run.done) |
| 102 | return [Effect.void, { _tag: "Running", run }] as const |
| 103 | } |
| 104 | return [Effect.void, st] as const |
| 105 | }), |
| 106 | ).pipe(Effect.flatten) |
| 107 | |
| 108 | const stopShell = (shell: ShellHandle<A, E>) => |
| 109 | Effect.gen(function* () { |
no test coverage detected