LocalFirstStateEventBus
class LocalFirstStateEventBus(val distributedBus: DistributedStateEventBus, val localBus: LocalStateEventBus = InMemoryStateEventBus()) : StateEventBus, LocalFirstMessageBus<StateEvent<*>, StateEventExchange<*>>
State event bus that prioritizes local message delivery before distributed delivery. Messages are first sent to local subscribers within the same JVM instance, then forwarded to the distributed bus for cross-instance communication. This ensures low-latency local processing while maintaining consistency across instances.
Parameters
distributedBus
The distributed state event bus for cross-instance messaging.
localBus
The local state event bus for same-instance messaging (default: InMemoryStateEventBus).
Constructors
Link copied to clipboard
constructor(distributedBus: DistributedStateEventBus, localBus: LocalStateEventBus = InMemoryStateEventBus())