Skip to content

Let ThrottledStream be a wrapper around WeightedStream - #7

Merged
AhmedSoliman merged 2 commits into
mainfrom
pr7
Sep 9, 2025
Merged

Let ThrottledStream be a wrapper around WeightedStream#7
AhmedSoliman merged 2 commits into
mainfrom
pr7

Conversation

@AhmedSoliman

@AhmedSoliman AhmedSoliman commented Sep 9, 2025

Copy link
Copy Markdown
Owner

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the ThrottledStream implementation to be a thin wrapper around the existing WeightedStream, eliminating code duplication and improving maintainability. The refactor standardizes the API by making the token bucket optional in both stream types.

  • ThrottledStream is now a wrapper around WeightedStream with a unit weight function
  • WeightedStream now accepts optional token buckets like ThrottledStream
  • Version bump from 0.0.1-alpha.6 to 0.0.1-alpha.7

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/futures/stream.rs Refactored ThrottledStream to wrap WeightedStream, made token bucket optional in WeightedStream, added PhantomPinned marker
examples/streams.rs Increased number of concurrent streams from 100 to 1000 for testing
Cargo.toml Version bump to 0.0.1-alpha.7

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/futures/stream.rs Outdated
Comment thread src/futures/stream.rs Outdated
@AhmedSoliman
AhmedSoliman merged commit 81731b0 into main Sep 9, 2025
2 checks passed
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.

2 participants