Skip to content

add spmc ring sync example#191

Merged
lxsaah merged 5 commits into
aimdb-dev:mainfrom
harunugurlu:feat/184-hello-spmc-ring-example
Jul 18, 2026
Merged

add spmc ring sync example#191
lxsaah merged 5 commits into
aimdb-dev:mainfrom
harunugurlu:feat/184-hello-spmc-ring-example

Conversation

@harunugurlu

Copy link
Copy Markdown
Collaborator

Description

Adds the hello-spmc-ring example demonstrating the SpmcRing buffer through AimDB's synchronous API.

The example:

  • registers a Temperature record backed by BufferCfg::SpmcRing { capacity: 10 }
  • publishes sensor readings using a synchronous SyncProducer
  • observes readings through configured fast and slow taps
  • demonstrates how each subscriber maintains an independent read position in the shared bounded sequence
  • shows the slow tap falling behind and later receiving every retained intermediate value in order
  • documents the contrast with hello-single-latest, where intermediate updates may be replaced
  • adds the example to the workspace, Makefile, and main README

Related Issue

Closes #184

Testing

The following commands completed successfully:

  • cargo fmt --all -- --check
  • cargo check -p hello-single-latest
  • cargo clippy -p hello-single-latest --all-targets -- -D warnings
  • cargo run -p hello-single-latest
  • make examples

make check completed all preceding checks but failed at the existing codegen-drift step on macOS because of a BSD sed regular-expression compatibility error:

sed: RE error: invalid repetition count(s)
make: *** [codegen-drift] Error 1

Checklist

  • I have read the [CONTRIBUTING.md](https://github.com/aimdb-dev/aimdb/blob/main/CONTRIBUTING.md) document.
  • My code follows the project's coding standards.
  • I have added tests to cover my changes. Not applicable: this PR adds a runnable documentation example rather than new library behavior.
  • All new and existing tests passed (make check). The command is currently blocked by the macOS sed compatibility issue described above.
  • I have updated the documentation accordingly.

@harunugurlu
harunugurlu requested a review from lxsaah as a code owner July 17, 2026 20:36
Comment thread Makefile
@harunugurlu

Copy link
Copy Markdown
Collaborator Author

@lxsaah Hey, thanks for the review. I have fixed the duplication in Makefile and resolved the conversation. Now it still says "1 review requesting changes by reviewers with write access. Cannot change this locked branch" Thus, can't merge it.

@harunugurlu
harunugurlu requested a review from lxsaah July 18, 2026 20:05
lxsaah and others added 2 commits July 18, 2026 23:28
The header lines in the expected-output block didn't match what main.rs
actually prints, showing rate-based stats instead of the interval/delay
values the code outputs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@lxsaah lxsaah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the branch and fixed the README output. It looks now good to me. Thank you!

@lxsaah
lxsaah merged commit cf3c4bd into aimdb-dev:main Jul 18, 2026
7 checks passed
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.

Add minimal example: hello-spmc-ring

2 participants