Skip to main content

Module events

Module events 

Source
Expand description

Generic event bus over tokio::sync::broadcast.

Single source of truth for the “subscribe to mutation events” pattern used across moonproof storage wrappers. Each consumer crate wraps its storage trait in a domain-specific type and routes notifications through this primitive — no need to reimplement the broadcast::channel + subscribe() + subscriber_count() boilerplate per domain.

Structs§

EventBus
Multi-producer multi-consumer event bus. Cheap to clone — the inner broadcast::Sender is Arc-backed.

Constants§

DEFAULT_CAPACITY
Default channel capacity. Slow subscribers that fall behind by more than this many events get a Lagged error from the receiver; recovery is “fetch the full state via the store’s get_all and resume listening”.