MCPcopy Index your code
hub / github.com/simstudioai/sim / withQueueLock

Method withQueueLock

apps/sim/executor/execution/engine.ts:254–266  ·  view source on GitHub ↗
(fn: () => Promise<T> | T)

Source from the content-addressed store, hash-verified

252 }
253
254 private async withQueueLock<T>(fn: () => Promise<T> | T): Promise<T> {
255 const prevLock = this.queueLock
256 let resolveLock: () => void
257 this.queueLock = new Promise((resolve) => {
258 resolveLock = resolve
259 })
260 await prevLock
261 try {
262 return await fn()
263 } finally {
264 resolveLock!()
265 }
266 }
267
268 private initializeQueue(triggerBlockId?: string): void {
269 if (this.context.runFromBlockContext) {

Callers 1

executeNodeAsyncMethod · 0.95

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected