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

Function disposeExecutor

apps/local/src/executor.ts:313–330  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

311export const getExecutorBundle = () => loadSharedHandle();
312
313export const disposeExecutor = async (): Promise<void> => {
314 const currentHandlePromise = sharedHandlePromise;
315 sharedHandlePromise = null;
316
317 const disposeCurrent = async (): Promise<void> => {
318 const handle = currentHandlePromise ? await handleOrNull(currentHandlePromise) : null;
319 if (handle) {
320 await ignorePromiseFailure("disposeExecutor", () => handle.dispose());
321 }
322 };
323
324 const nextLifecycle = sharedHandleLifecycle.then(disposeCurrent, disposeCurrent);
325 sharedHandleLifecycle = nextLifecycle.then(
326 () => undefined,
327 () => undefined,
328 );
329 await nextLifecycle;
330};
331
332export const reloadExecutor = async () => {
333 await disposeExecutor();

Callers 6

closeServerHandlersFunction · 0.90
createServerHandlersFunction · 0.90
disposeServerHandlersFunction · 0.90
executor.test.tsFile · 0.90
reloadExecutorFunction · 0.85

Calls

no outgoing calls

Tested by 1