Skip to content

docs(runtime): prefer ObserverRuntime examples#58

Merged
Lythaeon merged 1 commit into
mainfrom
docs/observer-runtime-style
Mar 21, 2026
Merged

docs(runtime): prefer ObserverRuntime examples#58
Lythaeon merged 1 commit into
mainfrom
docs/observer-runtime-style

Conversation

@Lythaeon

Copy link
Copy Markdown
Owner

Description

This PR updates the public SOF docs to prefer the newer ObserverRuntime composition style over the older run_async_* convenience wrappers.

The existing snippets were still valid, but they no longer reflected the clearest public API for new users after the lifecycle/runtime work landed in 0.11.0. This PR makes the docs match the intended runtime surface.

Changes

Detailed list of what changed:

  • crates/sof-observer/README.md: rewrote the runtime quickstart and plugin/extension examples to lead with ObserverRuntime::new()
  • docs/gitbook/crates/sof.md: updated the main sof crate page to show builder-style runtime composition
  • docs/gitbook/getting-started/install-sof.md: updated starter snippets to use ObserverRuntime::new() and attached hosts explicitly
  • docs/gitbook/getting-started/first-runtime.md: updated the progression and code samples to prefer ObserverRuntime + RuntimeSetup
  • docs/gitbook/use-sof/observer-service.md: updated the observer service example to use the composed runtime style
  • docs/gitbook/use-sof/observe-and-submit-service.md: updated the combined observe-and-submit example to use ObserverRuntime directly

For slice-related changes, include:

  • Affected slices: documentation only
  • Cross-slice communication changes (if any) and why: none
  • Migration requirements (if any): none; this is a docs refresh, not an API change

Motivation

Business motivation:

  • make the public docs match the cleaner API new adopters should actually copy
  • reduce confusion between convenience wrappers and the preferred runtime composition surface

Technical motivation:

  • ObserverRuntime is now the clearer top-level public style for runtime composition
  • the docs should lead with with_setup(...), with_plugin_host(...), and run_until_termination_signal() instead of older wrapper functions

Alternative approaches considered:

  • leaving the wrapper-based snippets in place because they still compile
  • adding ObserverRuntime as a secondary note instead of making it the primary documented path

Scope and impact

  • Affected slices: docs/GitBook and observer README
  • Data/API changes: none
  • Backward compatibility: fully backward compatible; docs only
  • Performance impact: none
  • Security impact: none

Testing

  • Unit tests
  • Integration tests
  • Manual verification
  • Performance checks (if applicable)
  • Security checks (if applicable)

Commands/results:

cargo fmt --all
cd docs/gitbook && npm run build

Related issues and documentation

  • Fixes:
  • Related:
  • Architecture docs: docs/architecture/README.md
  • Relevant ARD/ADR:
  • Operations/runbook updates:

Reviewer checklist

  • Code follows project standards and architecture constraints
  • Slice boundaries are respected (docs/architecture/ard/0003-slice-dependency-contracts.md)
  • Tests added/updated and passing
  • Documentation updated (README/docs/operations as needed)
  • No undocumented breaking change
  • Performance trade-offs documented where relevant
  • Security considerations addressed where relevant

Additional notes

  • The old run_async_* entrypoints are still valid convenience wrappers.
  • This PR only changes which style the docs recommend first for new code.

@Lythaeon Lythaeon merged commit 25155c4 into main Mar 21, 2026
0 of 2 checks passed
@Lythaeon Lythaeon deleted the docs/observer-runtime-style branch March 21, 2026 03:56
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