code: def stop(self, msg='Thread stopped'):
          
          with self._lock:
              if not self._thread_running:
                  return
              self._thread_running = False
          self._queue.put(_BaseSignalFxIngestClient._QUEUE_STOP)
          self._send_thread.join()
          _logger.debug(msg)
docs: Stop send thread and flush points for a safe exit.