code: def _main_loop(self):
          '''
          Continuous loop that reads from a kafka topic and tries to validate
          incoming messages
          '''
          self.logger.debug("Processing messages")
          old_time = 0
          while True:
              self._process_messages()
              if self.settings['STATS_DUMP'] != 0:
                  new_time = int(old_div(time.time(), self.settings['STATS_DUMP']))
                  # only log every X seconds
                  if new_time != old_time:
                      self._dump_stats()
                      old_time = new_time
  
              self._report_self()
              time.sleep(self.settings['SLEEP_TIME']f _main_loop(self):
          '''
          Continuous loop that reads from a kafka topic and tries to validate
          incoming messages
          '''
          self.logger.debug("Processing messages")
          old_time = 0
          while True:
              self._process_messages()
              if self.settings['STATS_DUMP'] != 0:
                  new_time = int(old_div(time.time(), self.settings['STATS_DUMP']))
                  # only log every X seconds
                  if new_time != old_time:
                      self._dump_stats()
                      old_time = new_time
  
              self._report_self()
              time.sleep(self.settings['SLEEP_TIME'])
docs: Continuous loop that reads from a kafka topic and tries to validate
          incoming messages