def METHOD_NAME(self):
    """Block until the work queue is empty."""
    _LOGGER.debug('waiting for all messages to be processed.')
    self._incoming.join()
    _LOGGER.debug('all messages processed.')
    old = self._failed
    self._failed = False
    return old