public QueueItem Enqueue(QueueItemType type, QueueAction action) { var item = new QueueItem(type, action); Enqueue(item); return(item); }
/// <summary> /// Enqueues the specified dependent to only execute after the specified dependencies have finished. If all the /// dependencies have already finished, then it will simply be enqueued on the main processor. /// </summary> public QueueItem EnqueueDependent(IEnumerable <QueueItem> dependencies, QueueItemType type, QueueAction action) { var dependent = new QueueItem(type, action); EnqueueDependent(dependencies, dependent); return(dependent); }
private ItemQueue GetQueue(QueueItemType type) { lock (queueCreationLocker) { ItemQueue queue; if (!queuesByType.TryGetValue(type, out queue)) { queue = new ItemQueue(this, type); queues = queues.Add(queue); queuesByType = queuesByType.Add(type, queue); } return(queue); } }
public bool IsCancellable(QueueProcessor processor, QueueItemType itemType) { return(isCancellable(processor, itemType)); }
public ItemQueue(QueueProcessor processor, QueueItemType type) { this.processor = processor; this.type = type; }
public QueueItem(QueueItemType type, QueueAction action) { this.action = action; Type = type; }
/// <summary> /// Enqueues the specified dependent to only execute after the specified dependency has finished. If this /// dependency has already finished, then it will simply be enqueued on the main processor. /// </summary> public QueueItem EnqueueDependent(QueueItem dependency, QueueItemType type, QueueAction action) { return(EnqueueDependent(new[] { dependency }, type, action)); }
public bool IsQueueIdle(QueueItemType type) { return(GetQueue(type).IsIdle); }