MCPcopy Index your code
hub / github.com/callstack/agent-device / withRequestExecutionLocks

Function withRequestExecutionLocks

src/daemon/request-execution-scope.ts:155–167  ·  view source on GitHub ↗
(
  locks: Map<string, Promise<unknown>>,
  keys: RequestExecutionLockKey[],
  task: () => Promise<T>,
)

Source from the content-addressed store, hash-verified

153}
154
155async function withRequestExecutionLocks<T>(
156 locks: Map<string, Promise<unknown>>,
157 keys: RequestExecutionLockKey[],
158 task: () => Promise<T>,
159): Promise<T> {
160 const [key, ...remainingKeys] = keys;
161 if (!key) return await task();
162 return await withKeyedLock(
163 locks,
164 key,
165 async () => await withRequestExecutionLocks(locks, remainingKeys, task),
166 );
167}
168
169function applyRequestCommandDefaults(req: DaemonRequest): DaemonRequest {
170 const flags = { ...(req.flags ?? {}) };

Callers 1

Calls 1

withKeyedLockFunction · 0.90

Tested by

no test coverage detected