Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions docs/asynchronous-outbound-messaging-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,30 @@ that would normally be dropped by the `PushPolicy::DropIfFull` or
part of the application is then responsible for consuming from the DLQ to
inspect, log, and potentially retry these failed messages.

The following sequence diagram illustrates how frames are routed when a DLQ is
configured:

Comment on lines +600 to +602
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.

🛠️ Refactor suggestion

Wrap the intro line and add a <description> tag for accessibility compliance

Documentation guidelines require paragraphs to be wrapped at 80 columns and each
Mermaid diagram to be preceded by a short description wrapped in a <description>
tag for screen-reader support (see earlier diagrams in this file).

Suggested patch:

-The following sequence diagram illustrates how frames are routed when a DLQ is configured:
+<description>The diagram shows how a frame moves from the producer to the
+`PushHandle`, falls back to the Dead Letter Queue (DLQ) when the primary queue
+is full, and is ultimately logged if both queues are saturated.</description>
+
+The following sequence diagram illustrates how frames are routed when a DLQ is
+configured:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The following sequence diagram illustrates how frames are routed when a DLQ is
configured:
<description>The diagram shows how a frame moves from the producer to the
`PushHandle`, falls back to the Dead Letter Queue (DLQ) when the primary queue
is full, and is ultimately logged if both queues are saturated.</description>
The following sequence diagram illustrates how frames are routed when a DLQ is
configured:
🤖 Prompt for AI Agents
In docs/asynchronous-outbound-messaging-design.md around lines 600 to 602, the
introductory line before the sequence diagram is not wrapped at 80 columns and
lacks a <description> tag for accessibility. Wrap the introductory text to
ensure no line exceeds 80 characters and add a <description> tag immediately
before the Mermaid diagram with a concise summary of the diagram's content to
support screen readers.

```mermaid
sequenceDiagram
participant Producer
participant PushHandle
participant HighPrioQueue
participant DLQ as DeadLetterQueue
Producer->>PushHandle: try_push(frame, priority, DropIfFull)
PushHandle->>HighPrioQueue: try_send(frame)
alt Queue full
PushHandle->>DLQ: try_send(frame)
alt DLQ full
PushHandle->>PushHandle: log error (frame lost)
else DLQ has space
DLQ-->>PushHandle: frame accepted
end
else Queue has space
HighPrioQueue-->>PushHandle: frame accepted
end
PushHandle-->>Producer: Ok or logs
```

### 5.3 Typed protocol errors

`WireframeError` distinguishes transport failures from protocol logic errors. A
Expand Down
2 changes: 1 addition & 1 deletion docs/asynchronous-outbound-messaging-roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ design documents.
([Design §5][design-errors]).
- [x] **Per-connection rate limiting** on pushes via a token bucket
([Resilience Guide §4.1][resilience-rate]).
- [ ] **Optional Dead Letter Queue** for full queues
- [x] **Optional Dead Letter Queue** for full queues
([Design §5.2][design-dlq]).

## 4. Observability and Quality Assurance
Expand Down
3 changes: 2 additions & 1 deletion docs/hardening-wireframe-a-guide-to-production-resilience.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ token-bucket algorithm is ideal.
use wireframe::push::PushQueues;

// Configure a connection to allow at most 100 pushes per second.
let (queues, handle) = PushQueues::<Frame>::bounded_with_rate(8, 8, Some(100));
let (queues, handle) =
PushQueues::<Frame>::bounded_with_rate(8, 8, Some(100)).unwrap();

// Passing `None` disables rate limiting entirely:
let (_unlimited, _handle) = PushQueues::<Frame>::bounded_no_rate_limit(8, 8);
Expand Down
42 changes: 21 additions & 21 deletions docs/rust-testing-with-rstest-fixtures.md
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,10 @@ When using `#[once]`, there are critical warnings:
the end of the test suite. This makes `#[once]` fixtures best suited for
truly passive data or resources whose cleanup is managed by the operating
system upon process exit.
1. **Functional Limitations:** `#[once]` fixtures cannot be `async` functions
2. **Functional Limitations:** `#[once]` fixtures cannot be `async` functions
and cannot be generic functions (neither with generic type parameters nor
using `impl Trait` in arguments or return types).
1. **Attribute Propagation:** `rstest` macros currently drop `#[expect]`
3. **Attribute Propagation:** `rstest` macros currently drop `#[expect]`
attributes. If you rely on lint expectations, use `#[allow]` instead to
silence false positives.

Expand Down Expand Up @@ -1168,13 +1168,13 @@ The following table summarizes key differences:
**Table 1:** `rstest` **vs. Standard Rust** `#[test]` **for Fixture Management
and Parameterization**

| Feature | Standard #[test] Approach | rstest Approach |
| Feature | Standard #[test] Approach | rstest Approach |
| ------------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| Fixture Injection | Manual calls to setup functions within each test. | Fixture name as argument in #[rstest] function; fixture defined with #[fixture]. |
| Parameterized Tests (Specific Cases) | Loop inside one test, or multiple distinct #[test] functions. | #[case(...)] attributes on #[rstest] function. |
| Parameterized Tests (Value Combinations) | Nested loops inside one test, or complex manual generation. | #[values(...)] attributes on arguments of #[rstest] function. |
| Async Fixture Setup | Manual async block and .await calls inside test. | async fn fixtures, with #[future] and #[awt] for ergonomic `.await`ing. |
| Reusing Parameter Sets | Manual duplication of cases or custom helper macros. | rstest_reuse crate with #[template] and #[apply] attributes. |
| Fixture Injection | Manual calls to setup functions within each test. | Fixture name as argument in #[rstest] function; fixture defined with #[fixture]. |
| Parameterized Tests (Specific Cases) | Loop inside one test, or multiple distinct #[test] functions. | #[case(...)] attributes on #[rstest] function. |
| Parameterized Tests (Value Combinations) | Nested loops inside one test, or complex manual generation. | #[values(...)] attributes on arguments of #[rstest] function. |
| Async Fixture Setup | Manual async block and .await calls inside test. | async fn fixtures, with #[future] and #[awt] for ergonomic `.await`ing. |
| Reusing Parameter Sets | Manual duplication of cases or custom helper macros. | rstest_reuse crate with #[template] and #[apply] attributes. |

This comparison highlights how `rstest`'s attribute-based, declarative approach
streamlines common testing patterns, reducing manual effort and improving the
Expand Down Expand Up @@ -1335,20 +1335,20 @@ provided by `rstest`:

**Table 2: Key** `rstest` **Attributes Quick Reference**

| Attribute | Core Purpose |
| Attribute | Core Purpose |
| ---------------------------- | -------------------------------------------------------------------------------------------- |
| #[rstest] | Marks a function as an rstest test; enables fixture injection and parameterization. |
| #[fixture] | Defines a function that provides a test fixture (setup data or services). |
| #[case(...)] | Defines a single parameterized test case with specific input values. |
| #[values(...)] | Defines a list of values for an argument, generating tests for each value or combination. |
| #[once] | Marks a fixture to be initialized only once and shared (as a static reference) across tests. |
| #[future] | Simplifies async argument types by removing impl Future boilerplate. |
| #[awt] | (Function or argument level) Automatically .awaits future arguments in async tests. |
| #[from(original_name)] | Allows renaming an injected fixture argument in the test function. |
| #[with(...)] | Overrides default arguments of a fixture for a specific test. |
| #[default(...)] | Provides default values for arguments within a fixture function. |
| #[timeout(...)] | Sets a timeout for an asynchronous test. |
| #[files("glob_pattern",...)] | Injects file paths (or contents, with mode=) matching a glob pattern as test arguments. |
| #[rstest] | Marks a function as an rstest test; enables fixture injection and parameterization. |
| #[fixture] | Defines a function that provides a test fixture (setup data or services). |
| #[case(...)] | Defines a single parameterized test case with specific input values. |
| #[values(...)] | Defines a list of values for an argument, generating tests for each value or combination. |
| #[once] | Marks a fixture to be initialized only once and shared (as a static reference) across tests. |
| #[future] | Simplifies async argument types by removing impl Future boilerplate. |
| #[awt] | (Function or argument level) Automatically .awaits future arguments in async tests. |
| #[from(original_name)] | Allows renaming an injected fixture argument in the test function. |
| #[with(...)] | Overrides default arguments of a fixture for a specific test. |
| #[default(...)] | Provides default values for arguments within a fixture function. |
| #[timeout(...)] | Sets a timeout for an asynchronous test. |
| #[files("glob_pattern",...)] | Injects file paths (or contents, with mode=) matching a glob pattern as test arguments. |

By mastering `rstest`, Rust developers can significantly elevate the quality and
efficiency of their testing practices, leading to more reliable and maintainable
Expand Down
Loading