예제 #1
0
파일: QueueHelper.cs 프로젝트: xh91900/Src
 public static bool AddTask(QueueManager.Item item)
 {
     if (InternalQueue.GetItemCount() + 1 > InternalConstant.DefaultQueueItemMaxCount)
     {
         throw new Exception(string.Format("队列长度已到达最大限制({0})", InternalConstant.DefaultQueueItemMaxCount));
     }
     return(InternalQueue.AddItem(item));
 }
예제 #2
0
파일: QueueHelper.cs 프로젝트: xh91900/Src
 protected void Execute()
 {
     while (true)
     {
         if (this._QueueManager.HasItem)
         {
             try
             {
                 QueueManager.Item tmpItem = this._QueueManager.GetItem();
                 if (tmpItem != null)
                 {
                     tmpItem.fn(tmpItem.data);
                 }
             }
             catch { }
         }
         Thread.Sleep(500);
     }
 }