Skip to content

drainWithDeadline

drainWithDeadline(work, ms): Promise<void>

Defined in: packages/agent/src/modules/acp/acpCommon.ts:167

Waits for work to settle, giving up after ms. Never rejects — the caller is tearing a session down, and a failure in what it is waiting on changes nothing about that.

The timer is cleared on the winning path and unreferenced regardless, so a close cannot leave a pending timer holding the process open.

Promise<void> | null

number

Promise<void>