docs: def stop(self):
          """
          Signals the worker threads to exit and waits on them.
          """
          if not self.stopped():
              self._stop.set()
              for worker in self._workers:
                  worker.join()