MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / createExecutorHandle

Function createExecutorHandle

apps/local/src/executor.ts:269–284  ·  view source on GitHub ↗
(options: LocalExecutorOptions = {})

Source from the content-addressed store, hash-verified

267};
268
269export 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
286class SharedHandleCreateError extends Data.TaggedError("SharedHandleCreateError")<{
287 readonly cause: unknown;

Callers 2

createServerHandlersFunction · 0.90
loadSharedHandleFunction · 0.85

Calls 4

createLocalExecutorLayerFunction · 0.85
ignorePromiseFailureFunction · 0.85
disposeMethod · 0.80
closeMethod · 0.65

Tested by

no test coverage detected