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

Multiple interval/intervalCap constraints? #176

Open
drmrbrewer opened this issue Feb 7, 2023 · 2 comments
Open

Multiple interval/intervalCap constraints? #176

drmrbrewer opened this issue Feb 7, 2023 · 2 comments

Comments

@drmrbrewer
Copy link

I am making calls to an API that has two separate rate limits in place:

  • max 60 requests per minute; and
  • max 4 requests per second

Is there a way of adhering to these rate limits using p-queue? So far as I can understand, I can only set a rate limit constraint based on one but not both, using interval/intervalCap?

@Richienb
Copy link
Collaborator

Richienb commented Feb 19, 2023

Perhaps a custom delay function could be provided that is called to arrange the delays itself?

@kent-amplitude
Copy link

What if you had two queues? One configured for 60 requests per minute, and another configured for 4 requests per second, then make each function call run through both queues.

I haven't tested this out, but I think this should work.

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

No branches or pull requests

3 participants