MCPcopy Create free account
hub / github.com/anomalyco/opencode / wait

Function wait

packages/app/src/utils/worktree.ts:63–75  ·  view source on GitHub ↗
(scope: ServerScope, directory: string)

Source from the content-addressed store, hash-verified

61 waiter.resolve(next)
62 },
63 wait(scope: ServerScope, directory: string) {
64 const id = key(scope, directory)
65 const current = state.get(id)
66 if (current && current.status !== "pending") return Promise.resolve(current)
67
68 const existing = waiters.get(id)
69 if (existing) return existing.promise
70
71 const waiter = deferred()
72
73 waiters.set(id, waiter)
74 return waiter.promise
75 },
76}

Callers

nothing calls this directly

Calls 4

keyFunction · 0.70
deferredFunction · 0.70
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected