pub async fn next_task( task_queue: &TaskQueue, tasks_per_loop: isize, wait_duration: Duration) -> PuffResult<Task>