code: def _heartbeat_loop(self):
          
          self.logger.debug("running main heartbeat thread")
          while not self.closed:
              time.sleep(self.settings['SLEEP_TIME'])
              self._report_self()
docs: A main run loop thread to do work