Files
modules/routing-advanced

Routing (advanced)

Path: modules/routing-advanced/ · Modules: 5 (production)

Resilience and placement helpers: circuit breakers, geo hints, load spread, retry policies, sticky sessions.

Modules

Module Protocol Mode Highlights
hyper-p2p-circuit-breaker circuit-breaker/v1 local shouldAllow, openCount(), listCircuitIds
hyper-p2p-geo-hint-router geo-hint-router/v1 P2P routeTopN, peersInRadius, haversine distance
hyper-p2p-load-spread load-spread/v1 P2P pickTop, incrementLoad, totalLoad
hyper-p2p-retry-policy retry-policy/v1 local Backoff + jitter executor
hyper-p2p-sticky-session sticky-session/v1 P2P Client → peer binding

Quick start

const { HyperP2PCircuitBreaker } = require('hyper-p2p-circuit-breaker')
const cb = new HyperP2PCircuitBreaker({ failureThreshold: 3 })
cb.register('upstream')
if (cb.shouldAllow('upstream')) { /* call */ cb.recordSuccess('upstream') }

Test

cd hyper-p2p-circuit-breaker && npm test