MCPcopy Create free account
hub / github.com/Effect-TS/effect / cut

Function cut

packages/platform/node/test/cluster-integration/harness.ts:330–338  ·  view source on GitHub ↗
(source: string, target: string)

Source from the content-addressed store, hash-verified

328 }
329
330 const cut = (source: string, target: string) =>
331 Effect.sync(() => {
332 const active = connections.get(linkKey(source, target))
333 const socket = active?.values().next().value as Net.Socket | undefined
334 if (socket === undefined) {
335 throw new Error(`No active socket from ${source} to ${target}`)
336 }
337 socket.destroy(new Error(`Socket cut from ${source} to ${target}`))
338 })
339
340 return { add, cut, remove }
341}

Callers

nothing calls this directly

Calls 5

linkKeyFunction · 0.85
getMethod · 0.65
nextMethod · 0.65
syncMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected