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

[proposal] Add support for throttling per route #615

Open
jamesls opened this issue Nov 17, 2017 · 7 comments
Open

[proposal] Add support for throttling per route #615

jamesls opened this issue Nov 17, 2017 · 7 comments

Comments

@jamesls
Copy link
Member

jamesls commented Nov 17, 2017

API Gateway has various forms of API throttling. This proposal adds support for throttling at the routing level. This allows you to specify a rate and burst limit per @app.route.

Similar to CORS and authorizers, there will be a new param, throttle, that takes an instance of ThrottleConfig:

@app.route('/', throttle=ThrottleConfig(rate=10, burst=15))
def index(): pass

ThrottleConfig accepts two arguments, rate and burst:

class ThrottleConfig(object):
    def __init__(self, rate: int, burst: int): pass

The rate and burst params map to the corresponding concepts described in the API Gateway throttling docs

@kyleknap
Copy link
Member

It might be good to mention that we could potentially attach the ThrottleConfig to the app.api as well to represent the stage-wide throttle configuration. Otherwise, 🚢

@atyshka
Copy link

atyshka commented Aug 3, 2020

3 years later... any updates on this? Very useful feature

@isohrab
Copy link

isohrab commented Mar 25, 2021

4 years later... any updates on this? Very useful feature

@tedmiston
Copy link

Would be awesome to have

@dhensen
Copy link
Contributor

dhensen commented Sep 29, 2021

We are getting this when?

@denpufa
Copy link

denpufa commented Mar 27, 2022

5 years later... any updates on this? very useful feature

@nqbao
Copy link

nqbao commented Mar 15, 2023

6 years later.... i guess it never comes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants