Skip to content

Document fairness counter for push queues#135

Merged
leynos merged 5 commits intomainfrom
codex/design-fairness-mechanism-for-select-loop
Jun 26, 2025
Merged

Document fairness counter for push queues#135
leynos merged 5 commits intomainfrom
codex/design-fairness-mechanism-for-select-loop

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Jun 25, 2025

Summary

  • outline fairness counter in the push queue design document
  • add roadmap task to implement fairness in ConnectionActor
  • extend testing strategy notes for fairness

Testing

  • make fmt
  • make lint
  • make test
  • mdformat-all docs/asynchronous-outbound-messaging-design.md docs/asynchronous-outbound-messaging-roadmap.md docs/multi-layered-testing-strategy.md
  • markdownlint --fix ...
  • nixie docs/asynchronous-outbound-messaging-design.md docs/asynchronous-outbound-messaging-roadmap.md docs/multi-layered-testing-strategy.md

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

Summary by Sourcery

Document the new fairness mechanism for low-priority frames in the push queue design, update the roadmap with a task to implement fairness in ConnectionActor, and extend the testing strategy to cover the fairness counter behavior.

Documentation:

  • Add a new Design §3.2.1 section describing a configurable fairness counter and optional time slice to yield to low-priority frames under high-priority load
  • Update the roadmap to include a checklist item for implementing the fairness counter in ConnectionActor
  • Extend testing strategy notes to require validation of periodic low-priority processing when the fairness counter is configured

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jun 25, 2025

Reviewer's Guide

This PR introduces and documents a fairness counter for push queues in the ConnectionActor, ensuring low-priority frames make progress under continuous high-priority load; it updates the design spec, roadmap, and testing strategy accordingly.

Class diagram for ConnectionActor fairness counter addition

classDiagram
    class ConnectionActor {
        +int high_priority_counter
        +int max_high_before_low
        +with_fairness(usize)
        +process_high_priority_frame()
        +process_low_priority_frame()
    }
    ConnectionActor --> "1" high_priority_push_rx : receives
    ConnectionActor --> "1" low_priority_push_rx : receives

    class high_priority_push_rx {
        +try_recv()
    }
    class low_priority_push_rx {
        +try_recv()
    }
Loading

Flow diagram for fairness counter in push queue processing

flowchart TD
    A[Start select! loop] --> B{High-priority frame available?}
    B -- Yes --> C[Process high-priority frame]
    C --> D[Increment high_priority_counter]
    D --> E{high_priority_counter >= max_high_before_low?}
    E -- Yes --> F{Low-priority frame available?}
    F -- Yes --> G[Process low-priority frame]
    G --> H[Reset high_priority_counter]
    F -- No --> I[Continue]
    E -- No --> I
    B -- No --> J{Low-priority frame available?}
    J -- Yes --> K[Process low-priority frame]
    J -- No --> I
    I --> A
    H --> A
    K --> A
Loading

File-Level Changes

Change Details Files
Add fairness mechanism description to design doc
  • Insert new section detailing high-priority burst counter
  • Explain configurable threshold and optional time slice
  • Expose with_fairness(usize) API and default behavior
docs/asynchronous-outbound-messaging-design.md
Add roadmap task for fairness counter
  • Include unchecked item for fairness counter in roadmap
  • Link to new design section (§3.2.1)
docs/asynchronous-outbound-messaging-roadmap.md
Extend testing strategy to cover fairness
  • Update test objective to verify periodic low-priority frames under relentless high load
  • Clarify expected ordering behavior when fairness is enabled
docs/multi-layered-testing-strategy.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 Jun 25, 2025

Warning

Rate limit exceeded

@leynos has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 48 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between b1c30f1 and e39e682.

📒 Files selected for processing (2)
  • docs/asynchronous-outbound-messaging-design.md (1 hunks)
  • docs/asynchronous-outbound-messaging-roadmap.md (2 hunks)

Summary by CodeRabbit

  • Documentation
    • Added detailed explanation of fairness mechanisms for low-priority frames in the asynchronous outbound messaging design document, including configuration options and a flowchart.
    • Updated the roadmap to include a new task for implementing fairness in message prioritisation, with references to the relevant design section.
    • Clarified testing documentation to specify expected behaviour when fairness counters are enabled, ensuring periodic processing of low-priority frames.

Summary by CodeRabbit

  • Documentation
    • Added detailed explanation of fairness mechanisms for low-priority frames in the outbound messaging design document, including configuration options and a flowchart.
    • Updated the roadmap to include a new task for implementing fairness handling, with cross-references to the design section.
    • Clarified testing strategy documentation to specify expected behaviour when fairness counters are enabled, ensuring periodic delivery of low-priority frames.

Walkthrough

This update enhances documentation for the asynchronous outbound messaging system by introducing and detailing a fairness mechanism in the prioritised write loop. It describes logic to periodically process low-priority frames during high-priority bursts, updates the roadmap to include this task, and clarifies related testing expectations.

Changes

File(s) Change Summary
docs/asynchronous-outbound-messaging-design.md Added section on fairness for low-priority frames, describing counter and time-slice mechanisms, with a flowchart.
docs/asynchronous-outbound-messaging-roadmap.md Updated roadmap to include a task for implementing the fairness counter, referencing the new design section.
docs/multi-layered-testing-strategy.md Clarified test expectations regarding fairness: low-priority frames must appear during high-priority bursts.

Sequence Diagram(s)

sequenceDiagram
    participant HighPriorityQueue
    participant LowPriorityQueue
    participant WriteLoop

    loop Prioritised Write Loop
        WriteLoop->>HighPriorityQueue: Process high-priority frame
        alt High-priority burst threshold reached
            WriteLoop->>LowPriorityQueue: try_recv() for low-priority frame
            opt Low-priority frame available
                WriteLoop->>LowPriorityQueue: Process low-priority frame
                WriteLoop->>WriteLoop: Reset high-priority counter
            end
        end
        alt Time slice exceeded and low-priority not empty
            WriteLoop->>LowPriorityQueue: try_recv() for low-priority frame
        end
    end
Loading

Possibly related PRs

Poem

In the land of queues, both high and low,
Fairness now blossoms, letting all frames flow.
No more will the little ones wait in vain,
For bursts of priority now share the lane.
With counters and slices, the balance is right—
Every frame gets its moment, day or night!
🐇✨

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch codex/design-fairness-mechanism-for-select-loop

🪧 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!


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.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Jun 26, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 26, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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: 5

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d9e5bdf and d5675c8.

📒 Files selected for processing (3)
  • docs/asynchronous-outbound-messaging-design.md (1 hunks)
  • docs/asynchronous-outbound-messaging-roadmap.md (2 hunks)
  • docs/multi-layered-testing-strategy.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
`docs/**/*.md`: Use the markdown files within the `docs/` directory as a knowled...

docs/**/*.md: Use the markdown files within the docs/ directory as a knowledge base and source of truth for project requirements, dependency choices, and architectural decisions.
Proactively update the relevant file(s) in the docs/ directory to reflect the latest state when new decisions are made, requirements change, libraries are added/removed, or architectural patterns evolve.
Documentation in the docs/ directory must use en-GB-oxendict spelling and grammar, except for the word 'license'.

📄 Source: CodeRabbit Inference Engine (AGENTS.md)

List of files the instruction was applied to:

  • docs/multi-layered-testing-strategy.md
  • docs/asynchronous-outbound-messaging-roadmap.md
  • docs/asynchronous-outbound-messaging-design.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 by running nixie *.md **/*.md.
Markdown paragraphs and bullet points must be wrapped at 80 columns.
Code blocks in Markdown files must be wrapped at 120 columns.
Tables and headings in Markdown files must not be wrapped.

📄 Source: CodeRabbit Inference Engine (AGENTS.md)

List of files the instruction was applied to:

  • docs/multi-layered-testing-strategy.md
  • docs/asynchronous-outbound-messaging-roadmap.md
  • docs/asynchronous-outbound-messaging-design.md
`docs/**/multi-layered-testing-strategy.md`: Document advanced testing strategie...

docs/**/multi-layered-testing-strategy.md: Document advanced testing strategies, including concurrency fuzzing with loom and interaction fuzzing with proptest, as well as tests covering streams and push delivery.

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

List of files the instruction was applied to:

  • docs/multi-layered-testing-strategy.md
`docs/**/*.md`: Use British English spelling based on the Oxford English Diction...

docs/**/*.md: Use British English spelling based on the Oxford English Dictionary, except retain US spelling in API names (e.g., 'color').
Use the Oxford comma in lists.
Write headings in sentence case and use Markdown heading levels in order without skipping.
Follow markdownlint recommendations for Markdown formatting.
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' or angle brackets around the URL.
Expand any uncommon acronym on first use, e.g., Continuous Integration (CI).
Wrap paragraphs at 80 columns, code at 120 columns, and do not wrap tables.
Use footnotes referenced with '[^label]'.
When embedding figures, use 'alt text' and provide concise alt text describing the content.
Add a short description before each Mermaid diagram for screen readers.

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

List of files the instruction was applied to:

  • docs/multi-layered-testing-strategy.md
  • docs/asynchronous-outbound-messaging-roadmap.md
  • docs/asynchronous-outbound-messaging-design.md
`docs/**/asynchronous-outbound-messaging-design.md`: Document the design and imp...

docs/**/asynchronous-outbound-messaging-design.md: Document the design and implementation details for prioritized message queues, error handling, configuration hooks, push handle API, session registry, dead letter queue, and use cases as referenced in the roadmap.

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

List of files the instruction was applied to:

  • docs/asynchronous-outbound-messaging-design.md
🪛 LanguageTool
docs/multi-layered-testing-strategy.md

[style] ~416-~416: Since ownership is already implied, this phrasing may be redundant.
Context: ...rames are ever lost or reordered within their own channel. When the fairness counter is c...

(PRP_OWN)

docs/asynchronous-outbound-messaging-design.md

[uncategorized] ~145-~145: Possible missing comma found.
Context: ...e counter. An optional time slice (for example 100 µs) can also be configured. When th...

(AI_HYDRA_LEO_MISSING_COMMA)


[style] ~154-~154: Would you like to use the Oxford spelling “summarizes”? The spelling ‘summarises’ is also correct.
Context: ...-priority load. The flow diagram below summarises the fairness logic. ```mermaid flowcha...

(OXFORD_SPELLING_Z_NOT_S)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-test

Comment thread docs/asynchronous-outbound-messaging-design.md
Comment thread docs/asynchronous-outbound-messaging-design.md
Comment thread docs/asynchronous-outbound-messaging-design.md Outdated
Comment on lines +16 to +17
- [ ] **Fairness counter** to yield to the low-priority queue after a burst of
high-priority frames ([Design §3.2.1][design-fairness]).
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.

🧹 Nitpick (assertive)

Bullet width breaches 80-column rule

The new bullet for the fairness counter is > 80 characters. Re-wrap or split the sentence to satisfy the mandated line-length.

🤖 Prompt for AI Agents
In docs/asynchronous-outbound-messaging-roadmap.md around lines 16 to 17, the
bullet point for the fairness counter exceeds the 80-character line length
limit. Reformat the bullet by wrapping or splitting the sentence into multiple
lines so that no line exceeds 80 characters, ensuring readability and compliance
with the style guide.

Comment on lines +416 to +418
lost or reordered within their own channel. When the fairness counter is
configured, sequences containing relentless high-priority pushes must still
observe periodic low-priority frames.
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.

🧹 Nitpick (assertive)

Minor wording + wrap

  1. Sentence length exceeds 80 columns – re-wrap.
  2. “relentless” is informal; “continuous” would match the design doc’s wording.
-When the fairness counter is configured, sequences containing relentless high-priority pushes must still observe periodic low-priority frames.
+When the fairness counter is configured, sequences containing continuous high-priority pushes must still observe periodic low-priority frames.
📝 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
lost or reordered within their own channel. When the fairness counter is
configured, sequences containing relentless high-priority pushes must still
observe periodic low-priority frames.
lost or reordered within their own channel. When the fairness counter is
configured, sequences containing continuous high-priority pushes must still
observe periodic low-priority frames.
🧰 Tools
🪛 LanguageTool

[style] ~416-~416: Since ownership is already implied, this phrasing may be redundant.
Context: ...rames are ever lost or reordered within their own channel. When the fairness counter is c...

(PRP_OWN)

🤖 Prompt for AI Agents
In docs/multi-layered-testing-strategy.md around lines 416 to 418, re-wrap the
sentence to ensure no line exceeds 80 characters and replace the word
"relentless" with "continuous" to align with the design document's terminology.

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 d5675c8 and b1c30f1.

📒 Files selected for processing (2)
  • docs/asynchronous-outbound-messaging-design.md (1 hunks)
  • docs/multi-layered-testing-strategy.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
`docs/**/*.md`: Use the markdown files within the `docs/` directory as a knowled...

docs/**/*.md: Use the markdown files within the docs/ directory as a knowledge base and source of truth for project requirements, dependency choices, and architectural decisions.
Proactively update the relevant file(s) in the docs/ directory to reflect the latest state when new decisions are made, requirements change, libraries are added/removed, or architectural patterns evolve.
Documentation in the docs/ directory must use en-GB-oxendict spelling and grammar, except for the word 'license'.

📄 Source: CodeRabbit Inference Engine (AGENTS.md)

List of files the instruction was applied to:

  • docs/multi-layered-testing-strategy.md
  • docs/asynchronous-outbound-messaging-design.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 by running nixie *.md **/*.md.
Markdown paragraphs and bullet points must be wrapped at 80 columns.
Code blocks in Markdown files must be wrapped at 120 columns.
Tables and headings in Markdown files must not be wrapped.

📄 Source: CodeRabbit Inference Engine (AGENTS.md)

List of files the instruction was applied to:

  • docs/multi-layered-testing-strategy.md
  • docs/asynchronous-outbound-messaging-design.md
`docs/**/multi-layered-testing-strategy.md`: Document advanced testing strategie...

docs/**/multi-layered-testing-strategy.md: Document advanced testing strategies, including concurrency fuzzing with loom and interaction fuzzing with proptest, as well as tests covering streams and push delivery.

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

List of files the instruction was applied to:

  • docs/multi-layered-testing-strategy.md
`docs/**/*.md`: Use British English spelling based on the Oxford English Diction...

docs/**/*.md: Use British English spelling based on the Oxford English Dictionary, except retain US spelling in API names (e.g., 'color').
Use the Oxford comma in lists.
Write headings in sentence case and use Markdown heading levels in order without skipping.
Follow markdownlint recommendations for Markdown formatting.
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' or angle brackets around the URL.
Expand any uncommon acronym on first use, e.g., Continuous Integration (CI).
Wrap paragraphs at 80 columns, code at 120 columns, and do not wrap tables.
Use footnotes referenced with '[^label]'.
When embedding figures, use 'alt text' and provide concise alt text describing the content.
Add a short description before each Mermaid diagram for screen readers.

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

List of files the instruction was applied to:

  • docs/multi-layered-testing-strategy.md
  • docs/asynchronous-outbound-messaging-design.md
`docs/**/asynchronous-outbound-messaging-design.md`: Document the design and imp...

docs/**/asynchronous-outbound-messaging-design.md: Document the design and implementation details for prioritized message queues, error handling, configuration hooks, push handle API, session registry, dead letter queue, and use cases as referenced in the roadmap.

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

List of files the instruction was applied to:

  • docs/asynchronous-outbound-messaging-design.md
🪛 LanguageTool
docs/multi-layered-testing-strategy.md

[style] ~416-~416: Since ownership is already implied, this phrasing may be redundant.
Context: ...rames are ever lost or reordered within their own channel. When the fairness counter is c...

(PRP_OWN)

docs/asynchronous-outbound-messaging-design.md

[uncategorized] ~145-~145: Possible missing comma found.
Context: ...e counter. An optional time slice (for example 100 µs) can also be configured. When th...

(AI_HYDRA_LEO_MISSING_COMMA)


[style] ~158-~158: Would you like to use the Oxford spelling “summarizes”? The spelling ‘summarises’ is also correct.
Context: ...sable MD033 --> The flow diagram below summarises the fairness logic. The d...

(OXFORD_SPELLING_Z_NOT_S)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-test
🔇 Additional comments (2)
docs/asynchronous-outbound-messaging-design.md (1)

158-162: Accessibility note looks good — thanks for adding the <description> tag.

The diagram description is concise, wrapped to 80 columns, and satisfies md041.

docs/multi-layered-testing-strategy.md (1)

416-418: Wording and wrapping now comply with guidelines.

The sentence uses “continuous”, is below 80 columns, and reads cleanly.
No further changes required.

Comment on lines +145 to +151
An optional time slice (for example 100 µs) can also be configured. When the
elapsed time spent handling high-priority frames exceeds this slice, and the low
queue is not empty, the actor yields to a low-priority frame. Application
builders expose `with_fairness(usize)` to set the threshold, defaulting to 16.
An additional `with_fairness_time_slice(Duration)` method allows tuning of the
time-based yield. Setting the counter to zero preserves the original strict
ordering.
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.

🧹 Nitpick (assertive)

Consider consolidating the two builder methods into a single FairnessConfig.

with_fairness(usize) and with_fairness_time_slice(Duration) expose two entry
points for what is essentially one concern. A small struct or builder, e.g.

pub struct FairnessConfig {
    counter: usize,
    time_slice: Option<Duration>,
}

passed via with_fairness(cfg: FairnessConfig) would avoid API sprawl,
eliminate future breaking changes if more knobs are added, and make the
relationship between the two parameters explicit.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~145-~145: Possible missing comma found.
Context: ...e counter. An optional time slice (for example 100 µs) can also be configured. When th...

(AI_HYDRA_LEO_MISSING_COMMA)

🤖 Prompt for AI Agents
In docs/asynchronous-outbound-messaging-design.md around lines 145 to 151, the
two separate builder methods with_fairness(usize) and
with_fairness_time_slice(Duration) should be consolidated into a single method
that accepts a FairnessConfig struct. Define a FairnessConfig struct containing
both the counter and an optional time_slice field, then replace the two methods
with one that takes this struct as a parameter. This change simplifies the API,
groups related configuration together, and makes it easier to extend in the
future.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Jun 26, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 26, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Repository owner deleted a comment from coderabbitai Bot Jun 26, 2025
@leynos leynos merged commit 1ffe0b4 into main Jun 26, 2025
5 checks passed
@leynos leynos deleted the codex/design-fairness-mechanism-for-select-loop branch June 26, 2025 19:07
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