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

Apifriendly - enforce api rate limitations #12

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

davehayes
Copy link

I needed to write this for my own code, as I want to be friendly to the MusicBrainz servers. Thus I will be maintaining these for quite a while as it is how my code accesses MusicBrainz now and for the foreseeable future. In the spirit of open source, I offer these changes to the original repo if they are wanted.

This pull request adds the following features

  • automatic api rate limiting in fractions of a second
  • an optional cache, assuming one-to-one correspondence between a URL and results in a small window of time. This is so you don't make the same lookup more than once.
  • a user agent string or you can just provide an email
  • a non-blocking promise interface to search (and with rate limiting, this technique is ok to use now)

I'm open to comments or changes, or you can just completely ignore this pull request as ravings from a mad developer. ;)

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

Successfully merging this pull request may close these issues.

1 participant