What about the following:

```py
while no_limit or iterations < max_iterations:
        processed = _run(taskq_service, queue_names)
        tasks_processed += processed
        iterations += 1

        if not processed:
            break
```