Skip to content

Add async-stream example and tests#158

Merged
leynos merged 4 commits intomainfrom
codex/implement-async-stream-handler-with-tests
Jul 3, 2025
Merged

Add async-stream example and tests#158
leynos merged 4 commits intomainfrom
codex/implement-async-stream-handler-with-tests

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Jul 3, 2025

Summary

  • add async-stream dev dependency
  • demonstrate generating Response::Stream with async_stream in examples/async_stream.rs
  • mark roadmap task complete and reference new example
  • link to example from philosophy document
  • test streaming handler using async-stream

Testing

  • make fmt
  • make lint
  • make test

https://chatgpt.com/codex/tasks/task_e_686667d027448322b7c3ecb4677ba41d

Summary by Sourcery

Add an async-stream based example and tests for streaming responses, update docs and roadmap entries, and include the async-stream dependency.

Enhancements:

  • Add async_stream example demonstrating Response::Stream generation

Build:

  • Add async-stream crate as a development dependency in Cargo.toml

Documentation:

  • Update documentation to reference the async_stream example in the philosophy guide
  • Mark the async_stream example task complete in the roadmap

Tests:

  • Add a test for streaming handler using async_stream to verify ordered frame processing

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jul 3, 2025

Reviewer's Guide

This PR integrates the async-stream crate to generate streaming responses, adds a runnable example and corresponding tests, updates documentation to reference the new example, and includes the new dependency in the project manifest.

Sequence diagram for streaming frames with async-stream in the example

sequenceDiagram
    actor User
    participant Main as main()
    participant StreamResp as stream_response()
    participant Stream as Stream<Frame>
    User->>Main: Run example
    Main->>StreamResp: Call stream_response()
    StreamResp-->>Main: Return Response::Stream
    Main->>Stream: Iterate stream.next() (5 times)
    Stream-->>Main: Yield Frame(n)
    Main->>User: Print received frame: Frame(n)
Loading

Class diagram for the new Frame struct and stream_response function

classDiagram
    class Frame {
        +u32 0
        +Debug
        +PartialEq
        +bincode::Encode
        +bincode::BorrowDecode
    }
    class Response {
        <<generic>>
        +Stream(Pin<Box<dyn Stream<Item=Result<T, E>>>>)
    }
    Frame <.. Response : used as generic
    class stream_response {
        +stream_response() Response<Frame, ()>
    }
    stream_response ..> Response : returns
    stream_response ..> Frame : yields
Loading

File-Level Changes

Change Details Files
Add async-stream dependency to enable streaming support
  • Add async-stream = "0.3" to Cargo.toml
  • Update Cargo.lock to include async-stream
Cargo.toml
Cargo.lock
Create an example demonstrating Response::Stream with async-stream
  • Implement stream_response() yielding frames via async_stream::try_stream
  • Consume the Response::Stream in a Tokio main to print received frames
examples/async_stream.rs
Add integration test for streaming handler
  • Define a simple frame_stream() using try_stream! macro
  • Verify ConnectionActor processes frames in order in async test
tests/async_stream.rs
Update documentation to reference async-stream example
  • Link examples/async_stream.rs in philosophy document
  • Mark roadmap task complete and add example path in roadmap doc
docs/the-road-to-wireframe-1-0-feature-set-philosophy-and-capability-maturity.md
docs/asynchronous-outbound-messaging-roadmap.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 3, 2025

Summary by CodeRabbit

  • New Features

    • Added an example demonstrating asynchronous streaming of responses using the async-stream crate.
    • Introduced new documentation and diagrams to illustrate the streaming pattern and usage.
  • Documentation

    • Updated roadmap and philosophy documents for improved clarity and to reference new examples.
    • Added detailed example documentation for asynchronous streaming.
  • Tests

    • Added tests to verify correct consumption of frames from asynchronous streams.
  • Refactor

    • Introduced default type parameters to simplify usage of response and error types.

Summary by CodeRabbit

  • New Features
    • Added an example demonstrating asynchronous streaming of responses using the async-stream crate.
  • Documentation
    • Updated documentation to reference the new asynchronous streaming example and improved clarity in relevant sections.
  • Tests
    • Introduced tests to verify correct integration and sequential handling of async streams.
  • Chores
    • Added async-stream as a development dependency.

Walkthrough

The changes introduce the async-stream crate as a development dependency, add a new example demonstrating Response::Stream generation using async-stream, and provide a corresponding test for stream consumption. Documentation is updated to reference the new example and clarify the declarative streaming pattern.

Changes

File(s) Change Summary
Cargo.toml Added async-stream v0.3 to [dev-dependencies].
examples/async_stream.rs New example showing how to generate and consume Response::Stream using async-stream.
tests/async_stream.rs New test verifying correct sequential consumption of frames from an async stream by a ConnectionActor.
docs/asynchronous-outbound-messaging-roadmap.md Marked async-stream example as complete and specified its file location.
docs/the-road-to-wireframe-1-0-feature-set-philosophy-and-capability-maturity.md Improved clarity of unified Response enum section and referenced the new streaming example.
src/response.rs Added default type parameter E = () to FrameStream, Response, and WireframeError generics.
examples/async_stream.md Added new example documentation illustrating Response::Stream usage with async-stream, including diagrams.

Sequence Diagram(s)

sequenceDiagram
    participant Main as main()
    participant StreamFn as stream_response()
    participant Stream as async_stream
    participant Consumer as for frame in stream

    Main->>StreamFn: Call stream_response()
    StreamFn->>Stream: Create async stream yielding Frame(0..4)
    StreamFn-->>Main: Return Response::Stream(stream)
    Main->>Consumer: Extract stream from Response::Stream
    loop For each frame in stream
        Consumer->>Stream: Await next frame
        Stream-->>Consumer: Yield Frame(n)
        Consumer->>Main: Print frame
    end
Loading

Possibly related PRs

Poem

In the meadow of streams, async flows anew,
Frames hop in order, from zero up to two!
With crates and code, the rabbit’s delight—
Streaming responses, all handled just right.
Now docs and tests join the dance,
As bunnies in code fields merrily prance!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94ebb2a and 395cf6a.

📒 Files selected for processing (1)
  • examples/async_stream.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.md`: Validate Markdown files using `markdownlint *.md **/*.md`. Run `mdfor...

**/*.md: Validate Markdown files using markdownlint *.md **/*.md.
Run mdformat-all after any documentation changes to format all Markdown files and fix table markup.
Validate Markdown Mermaid diagrams using the nixie CLI. The tool is already installed; run nixie *.md **/*.md directly instead of using npx.
Markdown paragraphs and bullet points must be wrapped at 80 columns.
Code blocks must be wrapped at 120 columns.
Tables and headings must not be wrapped.

📄 Source: CodeRabbit Inference Engine (AGENTS.md)

List of files the instruction was applied to:

  • examples/async_stream.md
`**/*.md`: * Avoid 2nd person or 1st person pronouns ("I", "you", "we") * Use en...

**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")

  • Use en-oxendic spelling and grammar.
  • Paragraphs and bullets must be wrapped to 80 columns, except where a long URL would prevent this (in which case, silence MD013 for that line)
  • Code blocks should be wrapped to 120 columns.
  • Headings must not be wrapped.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • examples/async_stream.md
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-test
🔇 Additional comments (1)
examples/async_stream.md (1)

1-40: Documentation meets all Markdown guidelines – no action required

The heading, prose, and Mermaid diagrams are all properly formatted and wrapped within the prescribed limits, and the wording avoids disallowed pronouns. Looks good to merge.

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in a Comment
  • Commit Unit Tests in branch codex/implement-async-stream-handler-with-tests

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @leynos - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `examples/async_stream.rs:9` </location>
<code_context>
+
+use async_stream::try_stream;
+use futures::StreamExt;
+use wireframe::response::Response;
+
+#[derive(bincode::Encode, bincode::BorrowDecode, Debug, PartialEq)]
</code_context>

<issue_to_address>
Omit unused type parameter in Response; use Response<Frame> instead of Response<Frame, ()>.

The Response type is used as Response<Frame, ()>, but the second type parameter is not required or explained. Use Response<Frame> if the second parameter is unnecessary, or document its purpose if it is required.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread examples/async_stream.rs
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 171e81f and 5d2f5d0.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • Cargo.toml (1 hunks)
  • docs/asynchronous-outbound-messaging-roadmap.md (1 hunks)
  • docs/the-road-to-wireframe-1-0-feature-set-philosophy-and-capability-maturity.md (2 hunks)
  • examples/async_stream.rs (1 hunks)
  • tests/async_stream.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
`docs/**/*.md`: Documentation must use en-GB-oxendict spelling and grammar (with the exception of "license" which is to be left unchanged for community consistency).

docs/**/*.md: Documentation must use en-GB-oxendict spelling and grammar (with the exception of "license" which is to be left unchanged for community consistency).

📄 Source: CodeRabbit Inference Engine (AGENTS.md)

List of files the instruction was applied to:

  • docs/asynchronous-outbound-messaging-roadmap.md
  • docs/the-road-to-wireframe-1-0-feature-set-philosophy-and-capability-maturity.md
`**/*.md`: Validate Markdown files using `markdownlint *.md **/*.md`. Run `mdfor...

**/*.md: Validate Markdown files using markdownlint *.md **/*.md.
Run mdformat-all after any documentation changes to format all Markdown files and fix table markup.
Validate Markdown Mermaid diagrams using the nixie CLI. The tool is already installed; run nixie *.md **/*.md directly instead of using npx.
Markdown paragraphs and bullet points must be wrapped at 80 columns.
Code blocks must be wrapped at 120 columns.
Tables and headings must not be wrapped.

📄 Source: CodeRabbit Inference Engine (AGENTS.md)

List of files the instruction was applied to:

  • docs/asynchronous-outbound-messaging-roadmap.md
  • docs/the-road-to-wireframe-1-0-feature-set-philosophy-and-capability-maturity.md
`docs/**/*.md`: Provide user guides and examples demonstrating server-initiated messaging.

docs/**/*.md: Provide user guides and examples demonstrating server-initiated messaging.

📄 Source: CodeRabbit Inference Engine (docs/asynchronous-outbound-messaging-roadmap.md)

List of files the instruction was applied to:

  • docs/asynchronous-outbound-messaging-roadmap.md
  • docs/the-road-to-wireframe-1-0-feature-set-philosophy-and-capability-maturity.md
`docs/**/*.md`: Conventions for writing project documentation should follow the rules outlined in the documentation style guide.

docs/**/*.md: Conventions for writing project documentation should follow the rules outlined in the documentation style guide.

📄 Source: CodeRabbit Inference Engine (docs/contents.md)

List of files the instruction was applied to:

  • docs/asynchronous-outbound-messaging-roadmap.md
  • docs/the-road-to-wireframe-1-0-feature-set-philosophy-and-capability-maturity.md
`docs/**/*.md`: Use British English based on the Oxford English Dictionary (en-o...

docs/**/*.md: Use British English based on the Oxford English Dictionary (en-oxendict) for documentation.
The word "outwith" is acceptable in documentation.
Keep US spelling when used in an API, for example color.
Use the Oxford comma in documentation.
Company names are treated as collective nouns (e.g., "Lille Industries are expanding").
Write headings in sentence case in documentation.
Use Markdown headings (#, ##, ###, etc.) in order without skipping levels.
Follow markdownlint recommendations for Markdown files.
Provide code blocks and lists using standard Markdown syntax.
Always use fenced code blocks with a language identifier; use plaintext for non-code text.
Use - as the first level bullet and renumber lists when items change.
Prefer inline links using [text](url) or angle brackets around the URL in Markdown.
Expand any uncommon acronym on first use, for example, Continuous Integration (CI).
Wrap paragraphs at 80 columns in documentation.
Wrap code at 120 columns in documentation.
Do not wrap tables in documentation.
Use footnotes referenced with [^label] in documentation.
Include Mermaid diagrams in documentation where it adds clarity.
When embedding figures in documentation, use ![alt text](path/to/image) and provide concise alt text describing the content.
Add a short description before each Mermaid diagram in documentation so screen readers can understand it.

📄 Source: CodeRabbit Inference Engine (docs/documentation-style-guide.md)

List of files the instruction was applied to:

  • docs/asynchronous-outbound-messaging-roadmap.md
  • docs/the-road-to-wireframe-1-0-feature-set-philosophy-and-capability-maturity.md
`docs/**/*.md`: Write the official documentation for the new features. Create se...

docs/**/*.md: Write the official documentation for the new features. Create separate guides for "Duplex Messaging & Pushes", "Streaming Responses", and "Message Fragmentation". Each guide must include runnable examples and explain the relevant concepts and APIs.

📄 Source: CodeRabbit Inference Engine (docs/wireframe-1-0-detailed-development-roadmap.md)

List of files the instruction was applied to:

  • docs/asynchronous-outbound-messaging-roadmap.md
  • docs/the-road-to-wireframe-1-0-feature-set-philosophy-and-capability-maturity.md
`**/*.md`: * Avoid 2nd person or 1st person pronouns ("I", "you", "we") * Use en...

**/*.md: * Avoid 2nd person or 1st person pronouns ("I", "you", "we")

  • Use en-oxendic spelling and grammar.
  • Paragraphs and bullets must be wrapped to 80 columns, except where a long URL would prevent this (in which case, silence MD013 for that line)
  • Code blocks should be wrapped to 120 columns.
  • Headings must not be wrapped.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • docs/asynchronous-outbound-messaging-roadmap.md
  • docs/the-road-to-wireframe-1-0-feature-set-philosophy-and-capability-maturity.md
`Cargo.toml`: Use explicit version ranges in `Cargo.toml` and keep dependencies up-to-date.

Cargo.toml: Use explicit version ranges in Cargo.toml and keep dependencies up-to-date.

📄 Source: CodeRabbit Inference Engine (AGENTS.md)

List of files the instruction was applied to:

  • Cargo.toml
`**/*.rs`: Comment why, not what. Explain assumptions, edge cases, trade-offs, o...

**/*.rs: Comment why, not what. Explain assumptions, edge cases, trade-offs, or complexity. Don't echo the obvious.
Comments must use en-GB-oxendict spelling and grammar.
Function documentation must include clear examples.
Every module must begin with a module level (//!) comment explaining the module's purpose and utility.
Document public APIs using Rustdoc comments (///) so documentation can be generated with cargo doc.
Place function attributes after doc comments.
Do not use return in single-line functions.
Use predicate functions for conditional criteria with more than two branches.
Lints must not be silenced except as a last resort.
Lint rule suppressions must be tightly scoped and include a clear reason.
Prefer expect over allow.
Prefer .expect() over .unwrap().
Clippy warnings MUST be disallowed.
Fix any warnings emitted during tests in the code itself rather than silencing them.
Where a function is too long, extract meaningfully named helper functions adhering to separation of concerns and CQRS.
Where a function has too many parameters, group related parameters in meaningfully named structs.
Where a function is returning a large error consider using Arc to reduce the amount of data returned.
Write unit and behavioural tests for new functionality. Run both before and after making any change.
Prefer immutable data and avoid unnecessary mut bindings.
Handle errors with the Result type instead of panicking where feasible.
Avoid unsafe code unless absolutely necessary and document any usage clearly.

📄 Source: CodeRabbit Inference Engine (AGENTS.md)

List of files the instruction was applied to:

  • examples/async_stream.rs
  • tests/async_stream.rs
`**/*.rs`: * Seek to keep the cyclomatic complexity of functions no more than 12...

**/*.rs: * Seek to keep the cyclomatic complexity of functions no more than 12.

  • Adhere to single responsibility and CQRS

  • Place function attributes after doc comments.

  • Do not use return in single-line functions.

  • Move conditionals with >2 branches into a predicate function.

  • Avoid unsafe unless absolutely necessary.

  • Every module must begin with a //! doc comment that explains the module's purpose and utility.

  • Comments must use en-GB-oxendict spelling and grammar.

  • Lints must not be silenced except as a last resort.

    • #[allow] is forbidden.
    • Only narrowly scoped #[expect(lint, reason = "...")] is allowed.
    • No lint groups, no blanket or file-wide suppression.
    • Include FIXME: with link if a fix is expected.
  • Use rstest fixtures for shared setup and to avoid repetition between tests.

  • Replace duplicated tests with #[rstest(...)] parameterised cases.

  • Prefer mockall for mocks/stubs.

  • Prefer .expect() over .unwrap()

  • Ensure that any API or behavioural changes are reflected in the documentation in docs/

  • Ensure that any completed roadmap steps are recorded in the appropriate roadmap in docs/

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • examples/async_stream.rs
  • tests/async_stream.rs
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: leynos/wireframe#0
File: docs/asynchronous-outbound-messaging-roadmap.md:0-0
Timestamp: 2025-06-30T23:03:19.564Z
Learning: Applies to docs/**/*.rs : Document the use of `async-stream` for creating `Response::Stream` values.
docs/asynchronous-outbound-messaging-roadmap.md (1)
Learnt from: CR
PR: leynos/wireframe#0
File: docs/asynchronous-outbound-messaging-roadmap.md:0-0
Timestamp: 2025-06-30T23:03:19.564Z
Learning: Applies to docs/examples/**/*.rs : Include an example handler using `async-stream` demonstrating `Response::Stream` generation in the examples directory.
🧬 Code Graph Analysis (1)
tests/async_stream.rs (2)
tests/connection_actor.rs (1)
  • queues (18-18)
src/push.rs (1)
  • bounded (135-149)
🪛 LanguageTool
docs/the-road-to-wireframe-1-0-feature-set-philosophy-and-capability-maturity.md

[grammar] ~45-~45: Please add a punctuation mark at the end of paragraph.
Context: ...perative model. Handlers will return an enhanced Response enum, giving developers cle...

(PUNCTUATION_PARAGRAPH_END)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-test
🔇 Additional comments (10)
Cargo.toml (1)

23-23: LGTM: Appropriate dev-dependency addition.

The async-stream crate is correctly added as a dev-dependency with an explicit version range, which aligns with the coding guidelines for dependency management.

docs/asynchronous-outbound-messaging-roadmap.md (1)

34-35: LGTM: Roadmap task correctly marked as complete.

The checklist item accurately reflects the completion of the example handler and provides a clear reference to the specific file location.

docs/the-road-to-wireframe-1-0-feature-set-philosophy-and-capability-maturity.md (1)

91-91: LGTM: Helpful reference to practical example.

The addition of the example reference provides readers with a concrete demonstration of the streaming pattern described in the documentation.

tests/async_stream.rs (3)

1-5: LGTM: Well-documented module purpose.

The module-level documentation clearly explains the purpose and utility of the test module, following the coding guidelines requirement.


15-21: LGTM: Clean stream generation function.

The function demonstrates proper use of async_stream::try_stream! with appropriate error handling and simple, focused test data.


23-34: LGTM: Comprehensive integration test.

The test properly verifies the integration between async-stream and ConnectionActor, ensuring frames are processed in the correct order. Good use of rstest and appropriate setup of test infrastructure.

examples/async_stream.rs (4)

1-6: LGTM: Clear example documentation.

The module-level documentation effectively explains the example's purpose and demonstrates the key concepts being illustrated.


11-12: LGTM: Appropriate derive macros.

The Frame struct uses the correct derive macros for serialisation and debugging, which are essential for the wireframe framework.


14-21: LGTM: Clean stream generation pattern.

The function demonstrates the canonical pattern for creating Response::Stream values using async_stream::try_stream!, which aligns with the framework's recommended approach.


23-31: LGTM: Practical consumption example.

The main function shows realistic usage of the generated stream with proper pattern matching and error handling, making it a valuable reference for users.

Comment thread docs/the-road-to-wireframe-1-0-feature-set-philosophy-and-capability-maturity.md Outdated
@leynos leynos merged commit 9a9e26d into main Jul 3, 2025
5 checks passed
@leynos leynos deleted the codex/implement-async-stream-handler-with-tests branch July 3, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant