sir-lancebot
sir-lancebot copied to clipboard
Only allow 1 concurrent image processing command
Description
We limit add a global limit of 1 concurrent command at a time to the image processing commands (easterifiy, pride avatar 8bitify etc.). We should also run them in an executor so they are non-blocking.
Discussion of this started around here https://discord.com/channels/267624335836053506/635950537262759947/810933030125699143
Reasoning
Image processing commands can be quite CPU intensive, especially if the image is high resolution. We discussed adding a concurrency limit across the bot of only allowing 1 command to be ran at a time.
Also, running these in an executor will mean its no-longer blocking.
Proposed Implementation
Move all of the image processing commands into their own cog and have a grouped concurrency limit.
We should also port over the top-level aliases functionality from bot (https://github.com/python-discord/bot/pull/1124) so that the way to invoke the commands themselves does not change
Additional Details
Would you like to implement this yourself?
- [ ] I'd like to implement this feature myself
- [x] Anyone can implement this feature
We have an option on how to deal with concurrent requests, either we can queue them, or we can deny them and require the user to request them again. Is there any preference on either of these?
We have an option on how to deal with concurrent requests, either we can queue them, or we can deny them and require the user to request them again. Is there any preference on either of these?
I don't mind queueing, as long as we have some healthy maximum.
The issue itself looks good, go for it!
@ChrisLovering how's the 1 concurrent command at a time feature going?
Ah, I did not realise I was still assigned to this one, it's up for grabs for anyone to work on
i would like to work on this
@Vyvy-vi Sorry for the wait. I've assigned you. If you no longer want to work on this, just let me know.