Arguably, this is best handled in a dedicated library, but it makes sense to reference some example logic form this repository at least. See also clue/reactphp-mq#5 and clue/reactphp-mq#14
Refs https://www.digitalocean.com/docs/spaces/resources/performance-tips/#optimize-your-request-rate