ZeNyfh / gigavibe-java-edition

Music + Media bot made in java using JDA and Lavaplayer.
GNU General Public License v3.0
8 stars 3 forks source link

Look into threading command execution #169

Open 9382 opened 3 weeks ago

9382 commented 3 weeks ago

Currently, as far as I can tell, everything runs on the same thread. This turns bad when commands start taking a long time to complete (or worse, if the thread calls to sleep, like was fixed in ea56cea)

Making this process multithreaded is at least the first solution that comes to mind to prevent the bot from being force-hung, though other solutions are welcome

Not the largest priority right now since the player manager is non-blocking, so calls to play aren't dangerous, and there's nothing we do right now (off the top of my head) thats worryingly intensive

ZeNyfh commented 1 week ago

see https://github.com/ZeNyfh/gigavibe-java-edition/tree/command-threading for more details

specifically https://github.com/ZeNyfh/gigavibe-java-edition/commit/c996812e031968f9fc990c759f53d839310ae7c2 just needs a review and a bit of testing to see if it is in a working state.

I have done small scale testing and it seems to be fine with thread sleeps and playing/queuing tracks at the same time.