Libraries v5.2.0
    Preparing search index...

    Function withRequestSignal

    • Run cooperative work with cancellation on disconnect, deadline or caller abort.

      The visitor must observe its signal; this helper does not forcibly interrupt arbitrary promises. A normal response finish does not cancel the work. The deadline timer and all listeners are removed when work settles, including on failure. Already-aborted inputs reject without invoking the visitor.

      Type Parameters

      • T

      Parameters

      Returns Promise<T>

      await withRequestSignal(context, signal => loadReport(signal), {
      timeoutMs: 30_000
      });