EMRY-010: Processor trait + pipeline thread - #55
Merged
Conversation
emry-engine pipeline: a single thread drains the event ring, forwards each raw Event to the EventBus for observers, runs every Processor, and emits DerivedMetrics on a channel. Graceful shutdown on RunFinished or stop()/Drop; exits only when the ring is empty so pending events are always drained. Integration tests: no-op processor, derived-metric emission, stop-drain, Drop.
…Release/Acquire - Derived-metric channel is now bounded (DEFAULT_DERIVED_CAPACITY=16_384) with try_send + derived_dropped counter, matching the ring/bus drop policy. - stop()/Drop is prompt best-effort (stop flag checked at loop top), so Drop is bounded-time even under a flooding producer; RunFinished remains the graceful ordered-drain path. Documented the two contracts. - stop flag uses Release/Acquire (it gates control flow, unlike the ring's standalone Relaxed counter). - Add spawn_with_capacity; deterministic full-channel drop test.
CI's pre-commit hook regenerated Cargo.lock and flagged the uncommitted edge.
4 tasks
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.
Closes EMRY-010 (#8). Branched off
main. First M1 (engine) issue.What
processor.rs:Processortrait (on_event(&mut self, &Event) -> Vec<DerivedMetric>) +DerivedMetric.pipeline.rs:Pipelinespawns one thread that drains the ring, forwards each raw event to theEventBus, runs processors, and emits derived metrics on a bounded channel.Shutdown contract
RunFinished→ graceful, ordered: all prior events drained before the thread exits.stop()/Drop→ prompt best-effort (flag checked each iteration), so Drop is bounded-time even under a flooding producer.Verification
./scripts/pre-commit-rust.shgreen: clippy-D warnings, 5 engine tests, pipeline.rs 98% lines, total 95.35%Review-driven changes