PetterKraabol / Twitch-Python

Object-oriented Twitch API for Python developers
https://pypi.org/project/twitch-python
MIT License
214 stars 37 forks source link

Added ability to define a socket timeout and subscribable callback for when irc thread closes #20

Closed TomRaymond closed 4 years ago

TomRaymond commented 4 years ago

I added this as a result of unreliable thread disposal via existing methods. Occasionally the irc socket will simply stop receiving from Twitch and become stuck in the socket.recv method (irc.py line 88). This is resolved by setting a reasonable socket timeout closing stuck threads. The 'thread_close' callback was also added to allow for recovery of chat functionality by the host application, subscribers have an accurate way of knowing when the previous connection has fully closed and creating a new one if desired.

sonarcloud[bot] commented 4 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information