Skip to content

Bound event consumers and specify stream completion - #45

Merged
AriusII merged 1 commit into
mainfrom
feat/cli-019-bounded-events
Sep 21, 2026
Merged

AriusII merged 1 commit into
mainfrom
feat/cli-019-bounded-events

Conversation

@AriusII

@AriusII AriusII commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #35.

  • replaces the unbounded pending-reader list with one active observation reader and one pending read;
  • rejects concurrent enumerators, while allowing a later reader after cancellation, terminal completion, or disposal;
  • completes and detaches a pending MoveNextAsync on enumerator disposal, so a disposed reader cannot absorb a later observation;
  • documents unicast/FIFO observation semantics, loss accounting, normal drain, terminal discard, and the separation between async observations and synchronous native decisions;
  • counts buffered observations discarded by a terminal failure or internal abort in DroppedEventCount.

Contract

IEventStreamLease<TEvent>.Events is a bounded unicast work queue, not a broadcast subscription. Callback admission never waits for reader consumption or reader continuations, but the implementation honestly remains lock-protected rather than lock-free. Complete() drains accepted observations; terminal failure and internal stream abort discard buffered observations and record that loss. The currently unavailable debugger/hotkey/timer/DBVM producers remain unavailable: this PR does not claim live Cheat Engine callback qualification.

Validation

  • dotnet restore .\\CheatEngine.Client.slnx --locked-mode
  • dotnet build .\\CheatEngine.Client.slnx --configuration Release --no-restore — passed, 0 warnings / 0 errors.
  • focused event tests — 22 passed.
  • full CheatEngine.Client.Core.Tests — 233 passed.
  • Native AOT reference probe publish and execution — passed.
  • full solution test run — 514 passed, 1 pre-existing failure in CheatEngineLuaGeneratorTests.ModuleAdapterSnapshotUsesOneAdmittedOperationAndPreflightsEveryExport: expected CRLF snapshot versus generated LF output. This is unrelated to the event-stream files and reproduces from the baseline.

Scope / limits

No public signatures, SDK ABI, native callback producer, or CE live claim changed. Producer callback/ABI qualification and measured host latency remain gated follow-up work.

Summary by CodeRabbit

  • Documentation

    • Clarified event stream buffering, overflow behavior, reader ownership, and lifecycle handling.
  • Behavioral Improvements

    • Event streams now support one active asynchronous reader at a time.
    • Concurrent readers are rejected until the active reader is disposed.
    • Waiting readers are completed safely during disposal, cancellation, closure, or failure.
    • Overflow failures report lost observations and terminate affected readers.
    • Accepted observations can continue publishing without waiting for slow consumers.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: ae3aecc4-ddf6-4b24-8f80-78df77856cc6

📥 Commits

Reviewing files that changed from the base of the PR and between 5a40f3e and f95f32b.

📒 Files selected for processing (6)
  • libs/CheatEngine.Client.Abstractions/Events/EventStreamOptions.cs
  • libs/CheatEngine.Client.Abstractions/Events/EventStreamOverflowPolicy.cs
  • libs/CheatEngine.Client.Abstractions/Events/IEventStreamLease.cs
  • libs/CheatEngine.Client.Core/Domains/Events/BoundedEventStream.cs
  • tests/CheatEngine.Client.Core.Tests/Domains/Events/BoundedEventStreamTests.cs
  • tests/CheatEngine.Client.Core.Tests/Domains/Events/EventStreamLeaseTests.cs
 _______________________________________________
< CodeRabbit: Because Jarvis was already taken. >
 -----------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@AriusII
AriusII merged commit 83949f3 into main Sep 21, 2026
4 of 5 checks passed
@AriusII
AriusII deleted the feat/cli-019-bounded-events branch September 21, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant