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

Use descriptive rate limit instead of delay in resource #220

Open
isra17 opened this issue Aug 5, 2022 · 1 comment
Open

Use descriptive rate limit instead of delay in resource #220

isra17 opened this issue Aug 5, 2022 · 1 comment
Labels
API Involve documented API enhancement New feature or request

Comments

@isra17
Copy link
Member

isra17 commented Aug 5, 2022

Replace default_delay by rate_limit that can be a rate by window. This way we could support API that support a given rate by month and bursting this rate in a few days instead of spreading the load through a month. We might want to support many rate limit so we can set 1000 per month and 1 per 5 seconds.

cc @mlefebvre

@isra17 isra17 added enhancement New feature or request API Involve documented API labels Aug 5, 2022
@isra17
Copy link
Member Author

isra17 commented Aug 5, 2022

I think something like:

---
apiVersion: saturn.flared.io/v1alpha1
kind: SaturnResource
metadata:
  name: example-api-key-1
spec:
  type: example.resources.TestApiKey
  data:
    key: example-api-key-1
  rate_limits:
    - 1000 per month
    - 1 per second

would work well. Note that we still need to support ResourceUsed with a delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Involve documented API enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant