Karmator
Karmator copied to clipboard
Throttling of messages
One reason behind having alternative way to inject messages into the queue is so that these can throttle theirselves. We'll still need to support async queue injection for external processes but how about having:
- A way in the sending layer to separate messages into groups (ie control messages has higher priority)
- Throttle specific groups (ie joins) to a certain rate and when not sending them let the other messages flow on out.
- Main issue might be to figure out how to bucket/classify them and ensure there isn't a queue starvation issue.
Super primitive version was implemented for the channel plugin via increasing series of delays, and then the bot spawning a thread for each delay value to sleep for x seconds then the message is sent.
The classification/throttling bits will still need to be implemented but we have something for channels for now.