(options: LocalExecutorOptions = {})
| 267 | }; |
| 268 | |
| 269 | export const createExecutorHandle = async (options: LocalExecutorOptions = {}) => { |
| 270 | const layer = createLocalExecutorLayer(options); |
| 271 | const runtime = ManagedRuntime.make(layer); |
| 272 | const bundle = await runtime.runPromise(LocalExecutorTag.asEffect()); |
| 273 | |
| 274 | return { |
| 275 | executor: bundle.executor, |
| 276 | plugins: bundle.plugins, |
| 277 | webBaseUrl: bundle.webBaseUrl, |
| 278 | db: bundle.db, |
| 279 | dispose: async () => { |
| 280 | await Effect.runPromise(Effect.ignore(bundle.executor.close())); |
| 281 | await ignorePromiseFailure("disposeRuntime", () => runtime.dispose()); |
| 282 | }, |
| 283 | }; |
| 284 | }; |
| 285 | |
| 286 | class SharedHandleCreateError extends Data.TaggedError("SharedHandleCreateError")<{ |
| 287 | readonly cause: unknown; |
no test coverage detected