MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / deferLiveThreadUpdate

Function deferLiveThreadUpdate

desktop/runtime-host/live-thread-publisher.ts:89–100  ·  view source on GitHub ↗
(
  runtime: PiRuntime,
  options: { requireStreaming?: boolean | undefined } = {},
)

Source from the content-addressed store, hash-verified

87}
88
89export function deferLiveThreadUpdate(
90 runtime: PiRuntime,
91 options: { requireStreaming?: boolean | undefined } = {},
92) {
93 cancelLiveThreadUpdate(runtime)
94 const timer = setTimeout(() => {
95 liveThreadUpdateTimers.delete(runtime)
96 if (options.requireStreaming !== false && !runtime.session.isStreaming) return
97 void publishThreadUpdate(runtime, 'update')
98 }, 0)
99 liveThreadUpdateTimers.set(runtime, timer)
100}
101
102export function scheduleLiveThreadUpdate(runtime: PiRuntime) {
103 if (liveThreadUpdateTimers.has(runtime)) return

Callers 2

handleRuntimeMessageEndFunction · 0.90
handleRuntimeMessageEndFunction · 0.90

Calls 2

cancelLiveThreadUpdateFunction · 0.70
publishThreadUpdateFunction · 0.70

Tested by

no test coverage detected