EMRY-010: Processor trait + pipeline thread #55

Merged
vxfemboy merged 3 commits from emry-010-pipeline into main 2026-06-25 02:10:24 +00:00
vxfemboy commented 2026-06-25 01:56:32 +00:00 (Migrated from github.com)

Closes EMRY-010 (#8). Branched off main. First M1 (engine) issue.

What

  • processor.rs: Processor trait (on_event(&mut self, &Event) -> Vec<DerivedMetric>) + DerivedMetric.
  • pipeline.rs: Pipeline spawns one thread that drains the ring, forwards each raw event to the EventBus, 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.sh green: clippy -D warnings, 5 engine tests, pipeline.rs 98% lines, total 95.35%
  • Tests: no-op integration (drain + bus forwarding + RunFinished), derived emission, full-channel drop accounting, prompt stop, Drop-without-join

Review-driven changes

  1. Derived channel unbounded → bounded + drop-count (matches ring/bus philosophy; reviewer conf 95).
  2. Drop could block forever under a flooding producer → prompt stop semantics; bounded-time Drop.
  3. stop flag Release/Acquire (control signal, distinct from the ring's standalone Relaxed counter).
Closes EMRY-010 (#8). Branched off `main`. First M1 (engine) issue. ## What - `processor.rs`: `Processor` trait (`on_event(&mut self, &Event) -> Vec<DerivedMetric>`) + `DerivedMetric`. - `pipeline.rs`: `Pipeline` spawns one thread that drains the ring, forwards each raw event to the `EventBus`, 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.sh` green: clippy `-D warnings`, 5 engine tests, pipeline.rs 98% lines, total 95.35% - Tests: no-op integration (drain + bus forwarding + RunFinished), derived emission, full-channel drop accounting, prompt stop, Drop-without-join ## Review-driven changes 1. Derived channel unbounded → **bounded + drop-count** (matches ring/bus philosophy; reviewer conf 95). 2. Drop could block forever under a flooding producer → **prompt stop** semantics; bounded-time Drop. 3. stop flag **Release/Acquire** (control signal, distinct from the ring's standalone Relaxed counter).
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
femboy/emry!55
No description provided.