MCPcopy
hub / github.com/BuilderIO/agent-native / runWithRequestContext

Function runWithRequestContext

packages/core/src/server/request-context.ts:92–97  ·  view source on GitHub ↗
(
  ctx: RequestContext,
  fn: () => T | Promise<T>,
)

Source from the content-addressed store, hash-verified

90 * async operations spawned from `fn` via `getRequestUserEmail()` / `getRequestOrgId()`.
91 */
92export function runWithRequestContext<T>(
93 ctx: RequestContext,
94 fn: () => T | Promise<T>,
95): T | Promise<T> {
96 return als.run(ctx, fn);
97}
98
99/**
100 * Return the active request context, if this call chain is running under one.

Callers 15

run.tsFile · 0.90
[...page].get.tsFile · 0.90
requireRequestContextFunction · 0.90
requireRequestContextFunction · 0.90
[id].patch.tsFile · 0.90
[id].delete.tsFile · 0.90
withAuthFunction · 0.90
withAuthFunction · 0.90
share.tsFile · 0.90
run.tsFile · 0.90
submissions.tsFile · 0.90

Calls 1

runMethod · 0.80

Tested by 1

listVisibleFunction · 0.68