MCPcopy
hub / github.com/TanStack/ai / push

Function push

packages/ai-client/src/connection-adapters.ts:288–298  ·  view source on GitHub ↗
(chunk: StreamChunk, runId?: string)

Source from the content-addressed store, hash-verified

286 let activeWaiters: Array<(chunk: StreamChunk | null) => void> = []
287
288 function push(chunk: StreamChunk, runId?: string): void {
289 if (runId) {
290 chunkRunIds.set(chunk, runId)
291 }
292 const waiter = activeWaiters.shift()
293 if (waiter) {
294 waiter(chunk)
295 } else {
296 activeBuffer.push(chunk)
297 }
298 }
299
300 return {
301 subscribe(abortSignal?: AbortSignal): AsyncIterable<StreamChunk> {

Callers 1

sendFunction · 0.70

Calls 2

setMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected