Files
modules/routing-advanced/hyper-p2p-load-spread
Raven ScottandCursor 38e30b63a1 Expand network, encoding, observability, routing, supercomputer, and CRDT APIs.
Adds snapshot() and batch helpers across network discovery/stack/transport, encoding-wire, observability, routing-advanced, supercomputer, state-crdts, scheduling-queues, and session-bridge modules.

Co-authored-by: Cursor <[email protected]>
2026-05-21 04:03:45 -04:00
..
2026-05-20 23:36:32 -04:00
2026-05-20 22:56:32 -04:00
2026-05-20 22:56:32 -04:00
2026-05-21 00:07:44 -04:00
2026-05-20 21:57:50 -04:00
2026-05-20 21:57:50 -04:00
2026-05-20 22:56:32 -04:00

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