Remote / foldkit-remote/port

portProtocol

function · packages/remote/src/port.ts:47

function portProtocol(
  open: () => MessagePort,
): Layer.Layer<RpcClient.Protocol, WorkerError>

Effect's RPC worker protocol over a MessagePort: what port runs on, for an RPC client of RemoteRpc made by hand. open is called for each connection the protocol makes (once, and again if it restarts), so it opens a new conversation each time, such as a MessageChannel whose other port goes to the server.