Add clear/list/bulk/count helpers across hyperdrive, autobase, CRDTs, observability, transport, pear-platform, and related categories for more complete manual module surfaces. Co-authored-by: Cursor <[email protected]>
hyper-p2p-load-spread
Pick the peer reporting the lowest load metric.
Protocol: load-spread/v1
When to use
- Work-stealing or least-loaded peer selection.
- Gossiping CPU/queue depth hints across a swarm topic.
When not to use
- Geographic affinity (use geo-hint-router).
- Sticky user sessions.
Quick start
const { HyperP2PLoadSpread } = require('hyper-p2p-load-spread')
const ls = new HyperP2PLoadSpread({ topic: 'workers' })
await ls.ready()
ls.registerPeer('w1', 0.2)
ls.registerPeer('w2', 0.9)
console.log(ls.pickPeer())
await ls.close()
Docs
Test
npm install && npm test