MCPcopy
hub / github.com/Effect-TS/effect / send

Function send

packages/platform-browser/src/internal/workerRunner.ts:34–39  ·  view source on GitHub ↗
(portId: number, message: O, transfer?: ReadonlyArray<unknown>)

Source from the content-addressed store, hash-verified

32
33 const ports = new Map<number, readonly [MessagePort, Scope.CloseableScope]>()
34 const send = (portId: number, message: O, transfer?: ReadonlyArray<unknown>) =>
35 Effect.sync(() => {
36 ;(ports.get(portId)?.[0] ?? self).postMessage([1, message], {
37 transfer: transfer as any
38 })
39 })
40
41 const run = Effect.fnUntraced(function*<A, E, R>(
42 handler: (portId: number, message: I) => Effect.Effect<A, E, R> | void

Callers

nothing calls this directly

Calls 2

syncMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected