MCPcopy Index your code
hub / github.com/TanStack/ai / drainPostStreamActions

Method drainPostStreamActions

packages/ai-client/src/chat-client.ts:1310–1321  ·  view source on GitHub ↗

* Drain and execute all queued post-stream actions

()

Source from the content-addressed store, hash-verified

1308 * Drain and execute all queued post-stream actions
1309 */
1310 private async drainPostStreamActions(): Promise<void> {
1311 if (this.draining) return
1312 this.draining = true
1313 try {
1314 let action: (() => Promise<void>) | undefined
1315 while ((action = this.postStreamActions.shift()) !== undefined) {
1316 await action()
1317 }
1318 } finally {
1319 this.draining = false
1320 }
1321 }
1322
1323 /**
1324 * Check if we should continue the flow and do so if needed

Callers 1

streamResponseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected