Created
August 12, 2020 13:57
-
-
Save adragomir/948cf8ffe842e0e084ede3e0383e3715 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