joshuaskelly / twitch-observer

Turn Twitch chatter into Python events
MIT License
26 stars 6 forks source link

Fixing Hanging Issue With Context Manager #47

Closed joshuaskelly closed 7 years ago

joshuaskelly commented 7 years ago

Overview

The issue was caused by line 327:

while self._outbound_event_queue and not force_stop:
    time.sleep(self._outbound_send_interval)

Calling stop with force_stop=True would skip waiting for the outbound events to be sent. Then it would stop the workers and do a bit of clean up logic. Then stop gets called a second time by the context manager and will enter an infinite loop if there are still events in the outbound event queue.

Changes