Example #1
0
        public QueueItem Enqueue(QueueItemType type, QueueAction action)
        {
            var item = new QueueItem(type, action);

            Enqueue(item);
            return(item);
        }
Example #2
0
        /// <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);
        }
Example #3
0
 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);
     }
 }
Example #4
0
 public bool IsCancellable(QueueProcessor processor, QueueItemType itemType)
 {
     return(isCancellable(processor, itemType));
 }
Example #5
0
 public ItemQueue(QueueProcessor processor, QueueItemType type)
 {
     this.processor = processor;
     this.type      = type;
 }
Example #6
0
        public QueueItem(QueueItemType type, QueueAction action)
        {
            this.action = action;

            Type = type;
        }
Example #7
0
 /// <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));
 }
Example #8
0
 public bool IsQueueIdle(QueueItemType type)
 {
     return(GetQueue(type).IsIdle);
 }