feat(supercomputer,experimental): expand gateway, cache, and memetic APIs
Net gateway unregister/reset, GPU slot holder lookup, cache clear, gravity-well sink peek, memetic host tracking, entropy spiral turns. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -85,6 +85,20 @@ class HyperP2PNetGateway extends EventEmitter {
|
||||
return this._usage.get(normalizePeerId(peerId)) || 0
|
||||
}
|
||||
|
||||
unregisterGateway (peerId) {
|
||||
const id = this._pid(peerId)
|
||||
this._usage.delete(id)
|
||||
return this._gateways.delete(id)
|
||||
}
|
||||
|
||||
resetUsage (peerId = null) {
|
||||
if (peerId) {
|
||||
this._usage.set(normalizePeerId(peerId), 0)
|
||||
return
|
||||
}
|
||||
for (const id of this._gateways.keys()) this._usage.set(id, 0)
|
||||
}
|
||||
|
||||
async ready () {
|
||||
if (this.swarm || !this.topic) return this
|
||||
await initModuleSwarm(this, {
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "hyper-p2p-net-gateway",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "hyper-p2p-net-gateway",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"b4a": "^1.6.7",
|
||||
|
||||
Reference in New Issue
Block a user