HypixelDev / PublicAPI

Official Java implementation of the Hypixel Public API.
https://api.hypixel.net
MIT License
533 stars 151 forks source link

Critical Bugfix - Sometimes, the reactor transport stops working #460

Closed GrizzlT closed 2 years ago

GrizzlT commented 3 years ago

I found out the reactor transport was bugged due to a mistake in concurrency. Since I'm the author of this particular part of the code I assume I should fix it as well. I have refactored the code using the java.util.concurrent.locks package into safer code while fixing said bug. Fixes #461

GrizzlT commented 3 years ago

The actual bug leading to this pull request seems to have been the wrong type of thread used to run the main loop on, after 60 seconds of idling, it automatically gets terminated. This also includes blocking threads. I changed this into using a single thread that only terminates when we explicitly tell it to.