New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve TwitchClientHelper class #61
Comments
Actually it was supposed to be 10 seconds to start off, i didn't update the comment. Do you think a 10 sec delay between polling the data is to long? |
Hey, I've noticed for example StreamElements has a shorter delay than 10 seconds. I do think 1 second would be better, if it does not ruin major performance. |
I find that 1 second is fine for implementations that would need real-time updates. |
It takes the api about 2-3 minutes until it reports the change because of caching on twitches side. Therefore it isn't really worth using up your api quota to request it every second. But its a good idea to make it configurable. |
There should be a configurable splay on this, possibly using a random value or exponential back off. Most API implementations handle this out of the box. It should be configurable and enabled on all APIs. |
Also, sleeping threads on large scale apps could be dangerous, might be a good idea to make the jump to a CompleteableFuture? |
I went and reviewed this class, there are some serious style and thread safety issues here.....
This should be a candidate for a large scale refactor. Enabling this feature could lead to many unintended consequences on API limits and JVM issues on a large scale and should not be considered anything more than a "demo" of what is possible. |
@boostchicken thanks a lot for the review again, i'm making this a checklist to work on as all points are valid. |
Description
The sleeping time should be 1 second, but it is 10 seconds.
twitch4j/twitch4j/src/main/java/com/github/twitch4j/TwitchClientHelper.java
Line 179 in 270e884
Solutions
Change 10000 to 1000
The text was updated successfully, but these errors were encountered: