Something went wrong. Try again.
collection of js libraries
Something went wrong. Try again.
1234567891011121314151617181920212223242526import { WorkerThreadTransport } from "../internal/transports/node-worker/worker.ts";import { RpcPeer } from "../internal/ipc-node.ts";import { mainContract, workerContract } from "./api.ts";
const workerRpc = new RpcPeer( { localContract: workerContract, remoteContract: mainContract, transport: new WorkerThreadTransport(), }, { add: async (params) => { console.log("add", params); return params.a + params.b; }, range: async function* (params) { console.log("range", params); for (let i = params.start; i < params.end; i++) { yield i; } }, },);
void workerRpc;