def cleanup(self):
        ''' Stop backgroud thread and cleanup resources '''
        self._processing_stop = True
        self._wakeup_processing_thread()
        self._processing_stopped_event.wait(3)
def cleanup ( self ) : self . _processing_stop = True self . _wakeup_processing_thread ( ) self . _processing_stopped_event . wait ( 3 )
Stop backgroud thread and cleanup resources