mikealmond / MusicBrainz

A PHP library to access MusicBrainz's Web Service v2
http://musicbrainz.org/doc/Development
MIT License
64 stars 26 forks source link

Implement (transparent) rate limiting #15

Open JonnyJD opened 9 years ago

JonnyJD commented 9 years ago

The MusicBrainz server requires clients to send not more than one request per second: http://musicbrainz.org/doc/Development/XML_Web_Service/Version_2#Limiting_Connections_to_the_MusicBrainz_Web_Service

This can be done easily by the user with sleep(), but it would be even better if this library could do it transparently as done in python-musicbrainzngs: http://python-musicbrainzngs.readthedocs.org/en/latest/api/#musicbrainzngs.set_rate_limit

mikealmond commented 9 years ago

@JonnyJD That's a good idea. I just pushed v0.2.2 with the sleep(1) in it. I'll look at making this more transparent in the next release.