Created
August 12, 2020 13:57
-
-
Save adragomir/fca4fbec5ad22cdc00cabf9798bfd624 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// is_throttled should throttle a request per api to 10 requests per second | |
function is_throttled(...) { | |
} | |
function api($endpoint) { | |
if (is_throttled(...)) { | |
return "429 too soon"; | |
} | |
return "Api content for " . $endpoint; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment