( getAppState: () => AppState, setAppState: SetAppState, )
| 253 | * This is the main polling loop called by the framework. |
| 254 | */ |
| 255 | export 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. |
nothing calls this directly
no test coverage detected