/** * RPC-style worker communication helpers. * * @module bquery/concurrency */ import type { CallWorkerMethodOptions, CreateRpcWorkerOptions, RpcWorker, WorkerRpcHandlers } from './types'; /** * Creates a reusable RPC-style worker with explicit named method dispatch. * * The worker processes one request at a time to keep lifecycle, timeout, abort, * and cleanup semantics aligned with the minimal Milestone 1 task API. * * @example * ```ts * import { createRpcWorker } from '@bquery/bquery/concurrency'; * * const rpc = createRpcWorker({ * sum: ({ values }: { values: number[] }) => values.reduce((total, value) => total + value, 0), * double: (value: number) => value * 2, * }); * * const total = await rpc.call('sum', { values: [1, 2, 3] }); * rpc.terminate(); * ``` */ export declare function createRpcWorker(handlers: TRoutes, options?: CreateRpcWorkerOptions): RpcWorker; /** * Executes a single named RPC method in a fresh worker and tears it down after * the response is received. * * @example * ```ts * import { callWorkerMethod } from '@bquery/bquery/concurrency'; * * const total = await callWorkerMethod( * { * sum: ({ values }: { values: number[] }) => * values.reduce((result, value) => result + value, 0), * }, * 'sum', * { values: [1, 2, 3] } * ); * ``` */ export declare function callWorkerMethod(handlers: TRoutes, method: TMethod, input: Parameters[0], options?: CallWorkerMethodOptions): Promise>>; //# sourceMappingURL=rpc.d.ts.map