Skip to content

Apifriendly - enforce api rate limitations #12

Open
davehayes wants to merge 5 commits intobfaist:masterfrom
davehayes:apifriendly
Open

Apifriendly - enforce api rate limitations #12
davehayes wants to merge 5 commits intobfaist:masterfrom
davehayes:apifriendly

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