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