boxlang-express 0.2.9
Released .
- Added
app.getClusterManager()— cross-process peer discovery and manager election backed by a durable, sharedcache(), so instances never need to know each other's addresses in advance. Two consumers built on top of it:app.schedule(intervalMs, callback, { clustered: true })(only the elected instance runs the tick, with passive failover on a missed heartbeat) andboxExpressStomp({ cluster: app.getClusterManager() })(relays a publish to every other instance over a mesh of outbound WebSocket connections, delivered through each instance's own subscriber/exchange/listener path — a message that arrived via the relay is never relayed back out). Configured viaboxlang.json'smodules.boxexpress.settings.cluster(module default: off) orapp.set("cluster", {...}).cacheProvideris required once enabled, and is validated at startup against BoxLang's ownIObjectStore.isDistributed()— the in-memory default cache is rejected outright rather than silently leaving every instance unable to see any peer, the same durability requirementboxExpressCacheStore()already has for sessions. Verified first across real separateboxlangOS processes (including a live leader-kill failover and a cross-process STOMP relay), then written up as tests/specs/ClusterManagerSpec.bx, ClusterSchedulerSpec.bx, and ClusterStompRelaySpec.bx. Deliberately not built: per-job leader affinity (one elected instance runs every clustered job, not different jobs on different instances), general peer-to-peer RPC, and binary relay payloads. See ClusterManager.bx and plans/cluster-support.md.