()
| 297 | * Drain all pending inbox messages and release retained history. |
| 298 | */ |
| 299 | export function drainInbox(): UdsInboxEntry[] { |
| 300 | const pending = inbox.splice(0, inbox.length) |
| 301 | inboxBytes = 0 |
| 302 | for (const entry of pending) { |
| 303 | entry.status = 'processed' |
| 304 | } |
| 305 | return pending |
| 306 | } |
| 307 | |
| 308 | function getMessageBytes(message: UdsMessage): number { |
| 309 | return Buffer.byteLength(jsonStringify(message), 'utf8') |
no outgoing calls
no test coverage detected