Class ClusterBus
java.lang.Object
com.kingsrook.qqq.backend.core.cluster.ClusterBus
Cluster control events (spec 2026-10-15-cluster-ha-design): when a node
changes something other nodes hold in memory - a session ends, the meta data
overlay changes, a cached record is edited - it publishes an event. Every
node (this one at once, the others through the transport) runs the handlers
registered for that event type. A node ignores its own events coming back
from the transport. Caches keep short TTLs as a safety net in case an event
is lost.
Handlers are global (ClusterBus.on) and run as the system user of the
instance the event arrived on.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidDisconnect an instance (shutdown, tests).static voidConnect an instance to its transport (idempotent).static voidon(String type, BiConsumer<QInstance, ClusterEvent> handler) Register a handler for an event type (it runs on every node).static voidpublish(QInstance instance, ClusterEvent event) Publish an event: handled on this node now, and sent to the others.
-
Method Details
-
on
Register a handler for an event type (it runs on every node). -
connect
Connect an instance to its transport (idempotent). Call at startup, so this node receives events before it publishes any. -
publish
Publish an event: handled on this node now, and sent to the others. -
close
Disconnect an instance (shutdown, tests).
-