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

Function awaitAbort

packages/plugins/mcp/src/sdk/connection.ts:242–249  ·  view source on GitHub ↗
(signal: AbortSignal)

Source from the content-addressed store, hash-verified

240
241/** An effect that completes when `signal` aborts (already-aborted = now). */
242const awaitAbort = (signal: AbortSignal): Effect.Effect<void> =>
243 Effect.callback<void>((resume) => {
244 if (signal.aborted) {
245 resume(Effect.void);
246 return;
247 }
248 signal.addEventListener("abort", () => resume(Effect.void), { once: true });
249 });
250
251/** JSON-RPC methods the 401 replay below may re-send. An HTTP 401 does not
252 * guarantee the server did no work before rejecting, so replay is limited to

Callers 1

executeFunction · 0.85

Calls 1

resumeFunction · 0.85

Tested by

no test coverage detected