MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / pollTasks

Function pollTasks

src/utils/task/framework.ts:255–269  ·  view source on GitHub ↗
(
  getAppState: () => AppState,
  setAppState: SetAppState,
)

Source from the content-addressed store, hash-verified

253 * This is the main polling loop called by the framework.
254 */
255export async function pollTasks(
256 getAppState: () => AppState,
257 setAppState: SetAppState,
258): Promise<void> {
259 const state = getAppState()
260 const { attachments, updatedTaskOffsets, evictedTaskIds } =
261 await generateTaskAttachments(state)
262
263 applyTaskOffsetsAndEvictions(setAppState, updatedTaskOffsets, evictedTaskIds)
264
265 // Send notifications for completed tasks
266 for (const attachment of attachments) {
267 enqueueTaskNotification(attachment)
268 }
269}
270
271/**
272 * Enqueue a task notification to the message queue.

Callers

nothing calls this directly

Calls 4

generateTaskAttachmentsFunction · 0.85
enqueueTaskNotificationFunction · 0.85
getAppStateFunction · 0.50

Tested by

no test coverage detected