Exemple #1
0
    private static void RunNextTask()
    {
        var nextTaskWrapper = currentTask?.GetCurrentTask();

        if (nextTaskWrapper == null || currentTask.cancelled)
        {
            currentTask     = null;
            nextTaskWrapper = null;
            if (queuedTasks.Count > 0)
            {
                currentTask     = queuedTasks.Dequeue();
                nextTaskWrapper = currentTask?.GetCurrentTask();
            }
        }

        if (nextTaskWrapper != null)
        {
            TaskManagerController.QueueTask(nextTaskWrapper);
        }
    }
Exemple #2
0
    public static bool IsBusy()
    {
        var currentTaskWrapper = currentTask?.GetCurrentTask();

        return(currentTaskWrapper != null && !currentTask.cancelled && TaskManagerController.HasTask(currentTaskWrapper));
    }