Skip to content

add hello-single-latest sync example#182

Merged
lxsaah merged 4 commits into
aimdb-dev:mainfrom
harunugurlu:feat/93-hello-single-latest-example
Jul 16, 2026
Merged

add hello-single-latest sync example#182
lxsaah merged 4 commits into
aimdb-dev:mainfrom
harunugurlu:feat/93-hello-single-latest-example

Conversation

@harunugurlu

@harunugurlu harunugurlu commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description

Adds hello-single-latest example demonstrating the SingleLatest buffer through AimDB's synchronous API.

The example:

  • registers an f32 feature-flag record backed by BufferCfg::SingleLatest
  • publishes rollout percentage updates using a synchronous SyncProducer
  • observes updates through configured "fast" and "slow" taps
  • documents the current-state semantics of SingleLatest
  • adds the example to the workspace, Makefile, and main README

Related Issue

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 and others added 2 commits July 15, 2026 21:43

@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.

Great iteration! The fast/slow taps demonstrate the SingleLatest coalescing cleanly and moving the delay/logging onto ctx is exactly right. Two small, optional polish suggestions inline:

Comment thread examples/hello-single-latest/Cargo.toml Outdated
Comment thread examples/hello-single-latest/src/main.rs Outdated
…atest example and update the Cargo.toml to remove unused tokio dependency
@harunugurlu harunugurlu requested a review from lxsaah July 15, 2026 21:28
@lxsaah

lxsaah commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Looks good. Thanks for your contribution!

@harunugurlu

Copy link
Copy Markdown
Contributor Author

Hey @lxsaah thanks a lot for your feedbacks and approving the PR. I can't seem to merge it though, it says "Merging is blocked, Cannot change this locked branch". Am I missing something here, or I simply don't have the authorization to merge?

@lxsaah lxsaah merged commit f8207f7 into aimdb-dev:main Jul 16, 2026
8 checks passed
@lxsaah

lxsaah commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

I merged the branch as there is authorization missing. Thanks again.

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-single-latest

2 participants