EMRY-006: EventBus pub/sub fan-out (bounded, drop-and-count) #54
No reviewers
Labels
No labels
blocked
bug
compat
docs
documentation
duplicate
emry-cli
emry-core
emry-engine
emry-ingest
emry-py
emry-store
emry-tui
emry-web
enhancement
good first issue
gpu-compute
help wanted
hpc
infra
integrations
invalid
needs-design
P0-blocker
P1-core
P2-enhanced
P3-future
performance
pull-request
python
pytorch
question
rust
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
femboy/emry!54
Loading…
Reference in a new issue
No description provided.
Delete branch "emry-006-event-bus"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes EMRY-006 (#7). Branched off
main. Completes M0.What
crates/emry-core/src/bus.rs—EventBusmulti-subscriber fan-out overcrossbeam_channel.subscribe()returns an independentReceiver;publish(&Event)clones to each live subscriber and never blocks.Backpressure (review-driven)
Per-subscriber channels are bounded (
DEFAULT_SUBSCRIBER_CAPACITY= 16 384) withtry_send: a stalled observer (e.g. wedged TUI render) has events dropped and counted (dropped()) instead of growing memory without limit — mirroring the ring buffer policy and the project's 'never harm the run' ethos. Disconnected receivers are pruned.Verification
./scripts/pre-commit-rust.shgreen: fmt, clippy-D warnings, tests, bus.rs 98% linesReview notes
try_send; engine drains on one thread) and documented the trade-off rather than adding a per-publish sender-list clone.