Remote / foldkit-remote-server/port
servePort
function · packages/remote-server/src/port.ts:19
function servePort<R>(
handlers: RemoteRpcClient<R>,
port: MessagePort,
): Effect.Effect<void, WorkerError, Exclude<R, Scope.Scope>>Serves handlers (RemoteServer.handlers(...)) over port, returning once
the client closes its end; interrupt it to stop sooner. Provide what the
handlers need. It fails with a WorkerError only when the port itself
breaks.