Closed mastercoms closed 9 years ago
Maybe make a scheduled task that sends the messages every seconds and clears the message cache.
Yes, I like that idea, but how will we handle multiple usernames? A task per username? And even then, semantics and meanings would be off, as the messages and responses would not be at the same time or appropriate position.
Slack can handle rate limiting by itself. It is just assuming too much to make rate limiting handling ourselves, as network efficiency can fluctuate at different times, making timings hard to control when sending several batch messages at once.
If there are a lot of messages at once, Slack will rate limit us to 1 message per second. We can solve this by sending batch messages, when someone sends more than 1 chat message in a row within a short period of time, without being interrupted, we can collect their messages until they are interrupted or stop. Also, if we get a 429 too many requests response code, we can hold off on the messages for the rate limit cooldown to recharge.