(wait: Call, calls: Call[], now: number)
| 79 | * agent must have finished a status read started after the attachment, or had the catch-up limit to do so. Acting |
| 80 | * sooner lets that read reveal the change before the listener can deliver it, which a real reviewer rarely causes. */ |
| 81 | export function readyForActor(wait: Call, calls: Call[], now: number): boolean { |
| 82 | const attached = attachedSince(wait); |
| 83 | if (attached === undefined || now - attached < actorReactionDelayMs) return false; |
| 84 | return now - attached >= actorCatchUpLimitMs || calls.some(call => call.startedAt >= attached |
| 85 | && call.endedAt !== undefined && statusRead(call) !== undefined); |
| 86 | } |
| 87 | |
| 88 | /** Repeated successful reads of the same projection between events count as polling. */ |
| 89 | export function statusRead(call: Call): string | undefined { |
no test coverage detected