Expand messaging, network, consensus, and platform module APIs.

Add batch helpers, clear utilities, and count methods for qos topics, brokers, probes, leases, locks, and registry modules.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-21 03:34:42 -04:00
co-authored by Cursor
parent e62d474134
commit 67219df1e1
21 changed files with 203 additions and 0 deletions
@@ -64,6 +64,20 @@ class HyperP2PRaftLite extends EventEmitter {
return this.truncateLog(0)
}
clearAll () {
const removed = this.clearLog()
this._currentTerm = 0
this._votedFor = null
this._commitIndex = -1
this._role = 'follower'
return removed
}
appendLogBatch (entries) {
if (!Array.isArray(entries)) throw new Error('entries array required')
return entries.map((entry) => this.appendLog(entry))
}
logEntryAt (index) {
return this._log[index] || null
}