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

Function createExecutorHandle

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

Source from the content-addressed store, hash-verified

239};
240
241export const createExecutorHandle = async (options: LocalExecutorOptions = {}) => {
242 const layer = createLocalExecutorLayer(options);
243 const runtime = ManagedRuntime.make(layer);
244 const bundle = await runtime.runPromise(LocalExecutorTag.asEffect());
245
246 return {
247 executor: bundle.executor,
248 plugins: bundle.plugins,
249 dispose: async () => {
250 await Effect.runPromise(Effect.ignore(bundle.executor.close()));
251 await ignorePromiseFailure("disposeRuntime", () => runtime.dispose());
252 },
253 };
254};
255
256class SharedHandleCreateError extends Data.TaggedError("SharedHandleCreateError")<{
257 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