/// <summary> /// Updates the status of the current batches. Will handle changing between batches. /// </summary> public void Update() { if (_batches.Count > 0) { TasksBatch top = _batches.Peek(); if (!top.IsStarted) { top.Start(_mailbox); } top.Update(); if (top.IsFinished) { _batches.Dequeue(); } } }
/// <summary> /// Queue a batch of tasks. /// </summary> /// <param name="tasks">Batch of tasks to run.</param> public void AddTasksBatch(TasksBatch tasks) { _batches.Enqueue(tasks); }