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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user