openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
14 lines (13 loc) • 456 B
JavaScript
import { AsyncResource } from "node:async_hooks";
//#region src/shared/async-store.ts
function enterAsyncStore(e, t) {
this.enterWith(e);
return t();
}
/** Enter once; the resource restores the caller's frame without copying it again. */
function runWithAsyncStore(e, t, n) {
if (e.getStore() === t) return n();
return new AsyncResource("OpenClawAsyncStore").runInAsyncScope(enterAsyncStore, e, t, n);
}
//#endregion
export { runWithAsyncStore as t };