a lot of refactos

This commit is contained in:
STEINNI
2026-06-21 21:08:46 +00:00
parent 3066a54a4c
commit 4c9e989bda
16 changed files with 472 additions and 60 deletions
+4 -4
View File
@@ -56,11 +56,11 @@ export class RequestorRegistry {
updatedAt: Date.now(),
})
this.#ensureTick()
this.#pushAgentEvents(this.requestors.get(id))
return({
ok: true,
frequency: frequencyMs,
agents: matching,
t,
})
}
@@ -130,9 +130,9 @@ export class RequestorRegistry {
return(matching)
}
#pushUpdate(requestor) {
#pushAgentEvents(requestor) {
if(typeof(this.onPush) !== 'function') return
this.onPush(requestor.id, {
void this.onPush(requestor.id, {
agents: [...requestor.agents],
t: requestor.t,
})
@@ -160,7 +160,7 @@ export class RequestorRegistry {
requestor.tickCounter++
if(requestor.tickCounter >= requestor.pushEveryNTicks) {
requestor.tickCounter = 0
this.#pushUpdate(requestor)
this.#pushAgentEvents(requestor)
}
}
if(this.debug) console.log(`[Observer] Scanned ${agents.size} agent(s) for ${this.requestors.size} requestor(s)`)