MCPcopy Index your code
hub / github.com/simstudioai/sim / handleChunk

Function handleChunk

apps/sim/executor/handlers/pi/cloud-backend.ts:239–249  ·  view source on GitHub ↗
(chunk: string)

Source from the content-addressed store, hash-verified

237
238 let buffer = ''
239 const handleChunk = (chunk: string) => {
240 buffer += chunk
241 const lines = buffer.split('\n')
242 buffer = lines.pop() ?? ''
243 for (const line of lines) {
244 const event = parseJsonLine(line)
245 if (!event) continue
246 applyPiEvent(totals, event)
247 context.onEvent(event)
248 }
249 }
250 const piRun = await raceAbort(
251 runner.run(PI_SCRIPT, {
252 envs: {

Callers

nothing calls this directly

Calls 2

parseJsonLineFunction · 0.90
applyPiEventFunction · 0.90

Tested by

no test coverage detected