[www] token drop performance improvement

This commit is contained in:
Devin Zuczek
2026-10-05 13:10:05 -04:00
parent 8ea72fcdc5
commit 0900bcac25
9 changed files with 645 additions and 78 deletions
+8
View File
@@ -35,6 +35,14 @@ export default defineConfig({
this.frames.push({ accountId, notificationType, payload })
return { delivered: 0, queued: true }
}
// One recorded frame per entry, the shape notifyPlayer records, so a test
// asserts the same thing whichever call sent it.
async notifyPlayers(notifications) {
for (const { playerId, notificationType, data } of notifications) {
this.frames.push({ accountId: playerId, notificationType, payload: data })
}
return { delivered: 0, queued: notifications.length }
}
async broadcast() { return { delivered: 0 } }
/** Everything pushed since the last call, then forget it. */
async drainFrames() {