Function: drainHost()
drainHost(
ctx,options?):Promise<DrainResult>
Defined in: sdk/ts/sdk/src/host/drain.ts:52
Ticks until a pass is quiet or the budget runs out. Host.drain wraps this and additionally shares one drain between concurrent callers; call that unless you hold a HostContext. Throws a plain Error on a context without the orchestrator role.
Parameters
ctx
options?
DrainOptions = {}
Returns
Promise<DrainResult>
Example
ts
// Inside a request on a `manual`-mode host: carry the run as far as it goes right now.
const result = await host.drain({ maxMs: 20_000 });
if (!result.idle) console.warn(`still busy after ${result.passes} passes`);