kkrpc
    Preparing search index...

    Function withCallOptions

    • Derive a remote proxy whose calls use per-call timeout and/or AbortSignal overrides, without changing the channel default.

      const api = wrap<RemoteAPI>(transport)
      const quick = withCallOptions(api, { timeout: 2000 })
      await quick.slowThing() // rejects after 2s instead of the channel timeout

      const controller = new AbortController()
      const cancelable = withCallOptions(api, { signal: controller.signal })
      cancelable.longRunning().catch(() => {})
      controller.abort()

      The options apply to every call made through the returned proxy (and nested property proxies derived from it). Throws if the value is not a kkrpc remote proxy.

      Type Parameters

      • T extends object

      Parameters

      Returns T