Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rate limiting / throttling of response downloads #352

Open
Kaliumhexacyanoferrat opened this issue Dec 16, 2022 · 1 comment
Open

Rate limiting / throttling of response downloads #352

Kaliumhexacyanoferrat opened this issue Dec 16, 2022 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Kaliumhexacyanoferrat
Copy link
Owner

As the developer of a web application, I would like to be able to throttle the bandwidth of certain responses, so that my app stays responsive on slow connections.

Example

var limit = Throttle.Connection()
                    .Limit(50); // kb/s

var app = Layout.Create()
                 .Add("myfile.zip", Download.From(...).Add(limit));

Hints

The concern could wrap the IResponseContent provided by the inner handler into a limited response content which passes a rate limited Stream instance into the inner response content.

Acceptance criteria

  • The functionality is implemented in a new module (such as GenHTTP.Modules.RateLimiting)
  • The functionality is implemented as an IConcern
  • Limit can be specified either per connection or as a total limit for all connections
  • Limits can be specified on a reasonable scale (such as kb/s)
  • The functionality introduces as few shared locks as possible
  • There are acceptance tests to ensure the implemented functionality
@Kaliumhexacyanoferrat Kaliumhexacyanoferrat added enhancement New feature or request good first issue Good for newcomers labels Dec 16, 2022
@wcontayon
Copy link
Contributor

Hi @Kaliumhexacyanoferrat great issue to work on 🙂 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants