Feature/add stop functionality#156
Conversation
will also free resources like listeners and thread pools
|
@Dustinhoefer Can you explain more on |
|
Yes, reconnecting is set to true, but at some point I simply want to completely stop reconnecting and free up all resources. Is there another way to do this? Use Case: User enables TikTok Chat Monitoring today and disables it tomorrow |
|
I do not think this was ever developed with that in mind to be honest. Idk if this is worth implementing into a library level. Our current thoughts were if the reconnect logic for a live client was to be done differently, we would just let them handle the reconnect logic themselves. This is currently what I do to manage my reconnects checking every 5+ mins roughly for my users. I would honestly recommend just doing that as it then becomes much easier to allocate/deallocate LiveClient instances and only keep the ones that you know are in use. |
|
Well, I would need to immediately know when someone goes live (thus the client with reconnect to true). But we also have users that have this functionality disabled (or disable it manually). Do you see a solution for this? |
|
No library is capable of knowing immediately when someone goes live as it requires polling requests to TikTok. Checking too often will get your IP banned. Regarding reconnecting though, I would simply have 2 different logic blocks. Then you can manually implement the reconnect logic to tune it to your amount of users while preventing your IP from sending too many requests. |
After using disconnect, the background threads will still try to reconnect indefinitely. Also the listeners were never cleared.