IFClite TypeScript API
    Preparing search index...

    Interface PortRpcOptions<Id>

    Transport-backed: the caller owns the listening and feeds inbound messages through receive() (and fatal transport failures through fail()).

    interface PortRpcOptions<Id> {
        close?: () => void;
        decode: (data: unknown) => RpcReply<Id> | undefined;
        label: string;
        nextId?: () => Id;
        onRequestTimeout?: "reject" | "kill";
        post: (message: unknown, transfer: Transferable[]) => void;
        requestTimeoutMs?: number;
    }

    Type Parameters

    • Id

    Hierarchy

    • RpcOptionsBase<Id>
      • PortRpcOptions
    Index
    close?: () => void

    Release the transport on death, if it has anything to release.

    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.

    post

    post: (message: unknown, transfer: Transferable[]) => void
    requestTimeoutMs?: number

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