MCPcopy Create free account
hub / github.com/arctic-cli/interface / wait

Function wait

packages/arctic/src/util/eventloop.ts:4–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3export namespace EventLoop {
4 export async function wait() {
5 return new Promise<void>((resolve) => {
6 const check = () => {
7 const active = [...(process as any)._getActiveHandles(), ...(process as any)._getActiveRequests()]
8 Log.Default.info("eventloop", {
9 active,
10 })
11 if ((process as any)._getActiveHandles().length === 0 && (process as any)._getActiveRequests().length === 0) {
12 resolve()
13 } else {
14 setImmediate(check)
15 }
16 }
17 check()
18 })
19 }
20}

Callers

nothing calls this directly

Calls 1

checkFunction · 0.85

Tested by

no test coverage detected