docs: def run(self):
          """Periodically sends buffered operations and/or commit.
          """
          if not self._should_auto_commit and not self._should_auto_send:
              return
          last_send, last_commit = 0, 0
          while not self._stopped:
              if self._should_auto_commit:
                  if last_commit > self._commit_interval:
                      self._docman.commit()
                      # commit also sends so reset both
                      last_send, last_commit = 0, 0
                      # Give a chance to exit the loop
                      if self._stopped:
                          break
  
              if self._should_auto_send:
                  if last_send > self._send_interval:
                      self._docman.send_buffered_operations()
                      last_send = 0
              time.sleep(self._sleep_interval)
              last_send += self._sleep_interval
              last_commit += self._sleep_interval