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

Feature request: rate limited queue #37

Closed
rjack opened this issue Jun 9, 2011 · 3 comments
Closed

Feature request: rate limited queue #37

rjack opened this issue Jun 9, 2011 · 3 comments

Comments

@rjack
Copy link

rjack commented Jun 9, 2011

Hi,

when using web services usually we must respect some rate limits.

Examples:

  • max 10000 hits per day
  • no more than 5 hits per minute
  • minimum 500ms between hits
  • ...

It would be nice to have a queue that is configurable with these rules, then one would just add jobs being sure that the web service's limits will be respected.

Does it smake sense?
Is this something that would be nice to have in async or it would be better implemented in a separate module?

Cheers,
Giacomo

@peritus
Copy link

peritus commented Jun 11, 2011

if (condition_met) {
  q.push(task(req));
} else {
  tell_user_we_are_sorry(req);
}

should do the trick, or am I missing something ?

@brianmaissy
Copy link
Contributor

I suggest this be closed

@caolan
Copy link
Owner

caolan commented Mar 2, 2013

For simple cases there's the throttle function in underscore.js, but for actual production use accessing an API having the async module keep track of API calls in memory wouldn't scale to multiple processes, so I think it would be limited in application. I don't think we should look to include this in async at the moment.

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

4 participants