Make frame processors stateless#70
Conversation
Reviewer's GuideThis PR refactors framing and serialization to be fully stateless and synchronous, introduces a pluggable File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis update introduces a generic Changes
Sequence Diagram(s)sequenceDiagram
participant App as WireframeApp
participant Handler as Handler
participant Serializer as Serializer
participant FrameProc as FrameProcessor
participant Stream as AsyncWrite
Handler->>App: Returns response (implements Responder)
App->>Serializer: serialize(response)
Serializer-->>App: Serialised bytes
App->>FrameProc: encode(bytes)
FrameProc-->>App: Framed bytes
App->>Stream: write(framed bytes)
Stream-->>App: Write result (Ok or Error)
Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate Unit Tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
… l7tg5u-codex/add-response-serialization-and-transmission
2efe165
into
codex/add-response-serialization-and-transmission
* Add module docstring for config module * Expand response tests and document serialization * Refine builder API and response serialization * Make frame processors stateless * Introduce trait-based serializer * Remove default() calls * Add doc comment for response tests (#70)
Summary
SendErrorpreserving encode and write failuresFrameProcessortrait to use synchronous, immutable methodsWireframeApp::send_responseto use&selfand returnSendErrorSerializerandBincodeSerializerdefault()calls in examples and testsTesting
cargo clippy -- -D warningsRUSTFLAGS="-D warnings" cargo testmarkdownlint docs/preamble-validator.md docs/roadmap.md docs/rust-binary-router-library-design.md docs/rust-testing-with-rstest-fixtures.md README.mdnixie docs/preamble-validator.md docs/roadmap.md docs/rust-binary-router-library-design.md docs/rust-testing-with-rstest-fixtures.md README.mdhttps://chatgpt.com/codex/tasks/task_e_6850a3439ea8832287c8431cdfbb87f9
Summary by Sourcery
Make frame processors stateless by refactoring the
FrameProcessortrait to synchronous immutable methods, introduceSendErrorfor improved error handling, switch to a trait-based serialization model, and bolster tests and documentation for response serialization.New Features:
SendErrortype to capture both encoding and write failuresSerializertrait andBincodeSerializerimplementationEnhancements:
FrameProcessortrait to use synchronous, immutable methodsWireframeApp::send_responseto take&selfand returnSendErrorDocumentation:
Tests:
Chores:
default()calls in examples and testsSummary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests