Repository navigation
feat(bus): filter subscriptions by source and subject - #217
Merged
Merged
Conversation
This was referenced Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type subscriptions currently send observations from every source and subject that has the same event kind. Add optional exact
sourceandsubjectselectors for ordinary subscriptions. The existing path argument selects the type with Router exact or wildcard matching. All supplied conditions must match; omitted selectors keep the current behavior.Validate each selector once with Zoi and compile one of three fixed Signal pattern-matching predicates. The Router route owns that predicate. Bus delivery uses Router's index lookup directly, so normal misses return an empty target list without constructing a discarded error. Router's public error contract is preserved. Repeated outer selector options and duplicate field keys are rejected before adding state. Selected observations retain Signal identity, Router order, and target cleanup. Durable subscriptions and replay reject selectors until their stored identity and cursor rules are defined.
Add selector benchmarks for source, subject, and combined hits and misses; full Bus publication; and subscription creation and removal. Routing cases use 256 to 4,096 candidates across exact and wildcard paths. Result checks verify exact targets, record identity, delivery counts, empty mailboxes, and process cleanup. The guides explain CloudEvents context, examples, support limits, and timing boundaries.
Validation on Elixir 1.18.4 / OTP 27:
--include flaky --warnings-as-errors: 502 tests each, no failures; 45 excluded.mix quality: formatting, compilation, Doctor, ExDoc, Credo, and Dialyzer pass.mix deps.unlock --check-unusedandmix hex.buildpass. Benchmarks and generated reports remain outside the Hex package.mix hex.auditreports the existing Decimal 3.1.1 advisory EEF-CVE-2026-97853, tracked in fix(v3): update the vulnerable Decimal lock dependency #215. The separate dependency PR fix(deps): update Decimal lock to 3.2.0 #218 fixes it. This PR does not changemix.lock.Closes #214
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.