sir-lancebot icon indicating copy to clipboard operation
sir-lancebot copied to clipboard

Only allow 1 concurrent image processing command

Open ChrisLovering opened this issue 4 years ago • 6 comments

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

ChrisLovering avatar Feb 15 '21 18:02 ChrisLovering

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?

ChrisLovering avatar Feb 16 '21 19:02 ChrisLovering

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!

Akarys42 avatar Feb 18 '21 17:02 Akarys42

@ChrisLovering how's the 1 concurrent command at a time feature going?

Xithrius avatar Aug 23 '21 07:08 Xithrius

Ah, I did not realise I was still assigned to this one, it's up for grabs for anyone to work on

ChrisLovering avatar Aug 23 '21 07:08 ChrisLovering

i would like to work on this

Vyvy-vi avatar Oct 02 '23 10:10 Vyvy-vi

@Vyvy-vi Sorry for the wait. I've assigned you. If you no longer want to work on this, just let me know.

Xithrius avatar Dec 01 '23 22:12 Xithrius