public static void AddResult(Results.IResult result) { if (currentContainer != null) { currentContainer.AddResult(result); } else { Results.ResultContainer container = new Results.ResultContainer(); container.AddResult(result); resultContainers.Enqueue(container); } }
private static void DelegateOutContainer() { bool dequeuedSomething = true; while (dequeuedSomething) { dequeuedSomething = false; //then do actual task processing (if tasks are now queued) foreach (Results.ResultBranch branch in outContainer.GetAllBranches()) { //find the next element for each branch and process it if (!branch.IsEmpty() && branch.IsReady()) { Results.IResult result = branch.Results.Dequeue(); result.Execute(); branch.Delay = result.Delay; dequeuedSomething = true; } } } }