code: def __spawn_new_requests(self):
          
  
          self.__should_spawn_new_requests = False
  
          in_progress_count = len(self.queue.get_all(QueueItem.STATUS_IN_PROGRESS))
  
          while in_progress_count < self.__options.performance.max_threads:
              if self.__spawn_new_request():
                  in_progress_count += 1
              else:
                  break
  
          if in_progress_count == 0:
              self.__crawler_stop()
docs: Spawn new requests until the max threads option value is reached.
  
          Note:
              If no new requests were spawned and there are no requests in progress
              the crawler will stop crawling.