( ctx: RequestContext, fn: () => T | Promise<T>, )
| 90 | * async operations spawned from `fn` via `getRequestUserEmail()` / `getRequestOrgId()`. |
| 91 | */ |
| 92 | export 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. |