swarpc - v0.14.0
    Preparing search index...

    Type Alias ClientMethod<P>

    ClientMethod: (
        input: P["input"]["inferIn"],
        onProgress?: (progress: P["progress"]["inferOut"]) => void,
    ) => Promise<P["success"]["inferOut"]> & {
        cancelable: (
            input: P["input"]["inferIn"],
            onProgress?: (progress: P["progress"]["inferOut"]) => void,
            requestId?: string,
        ) => CancelablePromise<P["success"]["inferOut"]>;
        broadcast: (
            input: P["input"]["inferIn"],
            onProgress?: (progresses: Map<string, P["progress"]["inferOut"]>) => void,
            nodes?: number,
        ) => Promise<
            (PromiseSettledResult<P["success"]["inferOut"]> & { node: string })[],
        >;
    }

    A procedure's corresponding method on the client instance -- used to call the procedure. If you want to be able to cancel the request, you can use the cancelable method instead of running the procedure directly.

    Type Parameters

    Type Declaration

      • (
            input: P["input"]["inferIn"],
            onProgress?: (progress: P["progress"]["inferOut"]) => void,
        ): Promise<P["success"]["inferOut"]>
      • Parameters

        • input: P["input"]["inferIn"]
        • OptionalonProgress: (progress: P["progress"]["inferOut"]) => void

        Returns Promise<P["success"]["inferOut"]>

    • cancelable: (
          input: P["input"]["inferIn"],
          onProgress?: (progress: P["progress"]["inferOut"]) => void,
          requestId?: string,
      ) => CancelablePromise<P["success"]["inferOut"]>

      A method that returns a CancelablePromise. Cancel it by calling .cancel(reason) on it, and wait for the request to resolve by awaiting the request property on the returned object.

    • broadcast: (
          input: P["input"]["inferIn"],
          onProgress?: (progresses: Map<string, P["progress"]["inferOut"]>) => void,
          nodes?: number,
      ) => Promise<
          (PromiseSettledResult<P["success"]["inferOut"]> & { node: string })[],
      >

      Send the request to specific nodes, or all nodes. Returns an array of results, one for each node the request was sent to. Each result is a PromiseSettledResult, with also an additional property, the node ID of the request