Exemplo n.º 1
0
 public void Enqueue(T item)
 {
     Value.Enqueue(item);
     if (Value.Count > size)
     {
         Value.Dequeue();
     }
     OnEnqueued?.Invoke(this, item);
 }
Exemplo n.º 2
0
 private void AtmptEnqueue()
 {
     if (List_PendingToEnqueue.Count > 0 && List_Queueing.Count < Capacity)
     {
         var load = List_PendingToEnqueue.First();
         Log("Enqueue", load);
         if (DebugMode)
         {
             Debug.WriteLine("{0}:\t{1}\tEnqueue\t{2}", ClockTime, this, load);
         }
         List_Queueing.Add(load);
         List_PendingToEnqueue.RemoveAt(0);
         HC_Queueing.ObserveChange(1, ClockTime);
         OnEnqueued.Invoke(load);
     }
 }