public void QueueOnChangeTask(IGooseAction action) { if (!this.mainQueue.Contains(action) && !this.currentBuildQueue.Contains(action) && this.AllowedToPlaceInMainQueue(action) && this.mainQueue.TryAdd(action)) { this.outputService.Debug<SynchronousOnChangeTaskDispatcher>("adding to queue: " + action.StartMessage); this.TriggerBuild(); } else { this.outputService.Debug<SynchronousOnChangeTaskDispatcher>("already on queue or building, skipping"); } }
private bool AllowedToPlaceInMainQueue(IGooseAction action) { return this.currentJob != action.GetHashCode(); }