MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / withAmbientDeadline

Function withAmbientDeadline

src/common/interruptible.ts:53–64  ·  view source on GitHub ↗
(
  deadline: number | undefined,
  fn: () => T
)

Source from the content-addressed store, hash-verified

51 * A frame is created per `withTimeLimit` span, so per-frame ticking makes
52 * that bound exact, at the cost of one property access.
53 */
54 tick?: number;
55}
56
57/**
58 * How many `iteration-limit-exceeded` cancellations have been RAISED over the
59 * life of the process. Monotonic; only ever compared before and after a
60 * computation, to answer "did this computation give up because of
61 * `engine.iterationLimit`?". An answer produced under a breached limit is
62 * limit-DEGRADED — a different `iterationLimit` could produce a different
63 * answer — so a memo must not freeze it (the collection-facet memo's
64 * settled-only gate consumes this, exactly like `cycleDetectionCount()`).
65 * Counted at the single raise site (the constructor below) rather than at the
66 * scattered catch sites that convert the error to an "unknown" answer.
67 */

Callers 2

extrapolateFunction · 0.90
monteCarloEstimateFunction · 0.90

Calls 1

fnFunction · 0.85

Tested by

no test coverage detected