feat(media,messaging,network): deepen streaming and transport APIs
Hyper-P2P Module Tests / unit-all (push) Failing after 1h16m23s
Hyper-P2P Module Tests / unit-all (push) Failing after 1h16m23s
Origin hybrid weighted select, latency path stats, live-edge listing; topic channel batch publish and retained clear; wakeup reschedule and cancelAll; electron bridge handler registry helpers. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -57,6 +57,21 @@ class HyperP2PLatencyOptimizer extends EventEmitter {
|
||||
return [...this._paths.keys()]
|
||||
}
|
||||
|
||||
clearPath (pathId) {
|
||||
return this._paths.delete(String(pathId))
|
||||
}
|
||||
|
||||
averageRtt () {
|
||||
const vals = [...this._paths.values()]
|
||||
if (!vals.length) return 0
|
||||
return vals.reduce((s, p) => s + p.rttMs, 0) / vals.length
|
||||
}
|
||||
|
||||
isWithinTarget (plan) {
|
||||
const glass = plan?.estimatedGlassMs ?? this.averageRtt() + 200
|
||||
return glass <= this.targetGlassMs
|
||||
}
|
||||
|
||||
getStats () {
|
||||
return mediaStats(this._stats, PROTOCOL, { paths: this._paths.size })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user