IFClite TypeScript API
    Preparing search index...

    Interface WorkerRpcOptions<Id>

    Worker-backed: posts to it, listens to its message/error/messageerror, terminates it on death.

    interface WorkerRpcOptions<Id> {
        decode: (data: unknown) => RpcReply<Id> | undefined;
        label: string;
        nextId?: () => Id;
        onRequestTimeout?: "reject" | "kill";
        requestTimeoutMs?: number;
        worker: RpcWorker;
    }

    Type Parameters

    • Id

    Hierarchy

    • RpcOptionsBase<Id>
      • WorkerRpcOptions
    Index
    decode: (data: unknown) => RpcReply<Id> | undefined

    Map one inbound message to the request it answers, or undefined to ignore it.

    label: string

    Names the endpoint in error messages, e.g. 'Re-mesh worker'.

    nextId?: () => Id

    Id generator; required unless ids are numbers (then 1, 2, 3, …).

    onRequestTimeout?: "reject" | "kill"

    'kill' (default): a missed deadline is fatal for the endpoint, for work that cannot be interrupted. 'reject': only the late request rejects.

    requestTimeoutMs?: number

    Default per-request deadline (see armDeadline). Default: none.

    worker: RpcWorker