Expand experimental, supercomputer, pear, collab, and messaging modules
Add manual API helpers across categories: entropy spiral prune, paradox clock compare/clear, mycelium pool borrow checks, pheromone and memetic batch helpers, phase-shift align, paradox merge all-open, mirror realm clear, work-stealer and thermal clearAll, cache warmBatch, GPU releaseAll, disk stripe completion, pear worker-pipe and channel registry, OTA history clear, import-map has/count, collab whiteboard batch and line locks, cursor presence, gossip mesh publishBatch, dedup allSeen, key rotation revokeAll, similarity LSH embedBatch, and bandwidth offer listing. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -62,6 +62,28 @@ class HyperP2PDocumentLineLock extends EventEmitter {
|
||||
return this._locks.get(this._key(docId, line)) || null
|
||||
}
|
||||
|
||||
listLocks (docId) {
|
||||
assertNonEmpty(docId, 'docId')
|
||||
return [...this._locks.values()].filter((l) => l.docId === docId)
|
||||
}
|
||||
|
||||
lockCount (docId = null) {
|
||||
if (!docId) return this._locks.size
|
||||
return this.listLocks(docId).length
|
||||
}
|
||||
|
||||
releaseAll (docId) {
|
||||
assertNonEmpty(docId, 'docId')
|
||||
let n = 0
|
||||
for (const [key, lock] of this._locks) {
|
||||
if (lock.docId === docId && lock.holder === this.holderHex) {
|
||||
this._locks.delete(key)
|
||||
n++
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
_onGossip (data) {
|
||||
if (!data) return
|
||||
this._stats.gossipIn++
|
||||
|
||||
Reference in New Issue
Block a user