def METHOD_NAME(self) -> None:
    logging.info("Worker loop started")
    try:
        while True:
            if self.has_resources() and self.process_next_job():
                # loop immediately to try another job
                # see https://github.com/huggingface/datasets-server/issues/265
                continue
            self.sleep()
    except BaseException:
        logging.exception("quit due to an uncaught error while processing the job")
        raise