Exemplo n.º 1
0
        public virtual StoreGet Get()
        {
            var get = new StoreGet(Environment, TriggerPut);

            GetQueue.Enqueue(get);
            TriggerGet();
            return(get);
        }
Exemplo n.º 2
0
        public virtual CraneScheduleStoreGet Get(ICraneAgent agent)
        {
            var get = new CraneScheduleStoreGet(Environment.Environment, agent);

            GetQueue.AddLast(get);
            TriggerGet();
            return(get);
        }
Exemplo n.º 3
0
        public virtual FilterStoreGet Get(Func <object, bool> filter = null)
        {
            var get = new FilterStoreGet(Environment, TriggerPut, filter ?? TrueFunc);

            GetQueue.AddLast(get);
            TriggerGet();
            return(get);
        }
Exemplo n.º 4
0
        public virtual FilterStoreGet Get(Func <object, bool> filter = null)
        {
            if (filter == null)
            {
                filter = _ => true;
            }
            var get = new FilterStoreGet(Environment, TriggerPut, filter);

            GetQueue.AddLast(get);
            TriggerGet();
            return(get);
        }
Exemplo n.º 5
0
        public virtual ContainerGet Get(double amount)
        {
            if (amount > Capacity)
            {
                throw new ArgumentException("Cannot get more than capacity", "amount");
            }
            var get = new ContainerGet(Environment, TriggerPut, amount);

            GetQueue.Enqueue(get);
            TriggerGet();
            return(get);
        }
Exemplo n.º 6
0
 protected virtual void TriggerGet(Event @event = null)
 {
     while (GetQueue.Count > 0)
     {
         var get = GetQueue.Peek();
         DoGet(get);
         if (get.IsTriggered)
         {
             GetQueue.Dequeue();
         }
         else
         {
             break;
         }
     }
 }
Exemplo n.º 7
0
 protected virtual void TriggerGet(Event @event = null)
 {
     while (GetQueue.Count > 0)
     {
         var get = GetQueue.Peek();
         DoGet(get);
         if (get.IsTriggered)
         {
             GetQueue.Dequeue();
             TriggerWhenAtMost();
             TriggerWhenChange();
         }
         else
         {
             break;
         }
     }
     Fillrate?.UpdateTo(Level / Capacity);
     GetQueueLength?.UpdateTo(GetQueue.Count);
 }
Exemplo n.º 8
0
 protected virtual void TriggerGet(Event @event = null)
 {
     while (GetQueue.Count > 0)
     {
         var get = GetQueue.Peek();
         DoGet(get);
         if (get.IsTriggered)
         {
             GetQueue.Dequeue();
             TriggerWhenEmpty();
             TriggerWhenChange();
         }
         else
         {
             break;
         }
     }
     Utilization?.UpdateTo(Count / (double)Capacity);
     WIP?.UpdateTo(Count + PutQueue.Count + GetQueue.Count);
     GetQueueLength?.UpdateTo(GetQueue.Count);
 }
Exemplo n.º 9
0
        protected virtual void TriggerGet(Event @event = null)
        {
            var current = GetQueue.First;

            while (current != null)
            {
                var get = current.Value;
                DoGet(get);
                if (get.IsTriggered)
                {
                    var next = current.Next;
                    GetQueue.Remove(current);
                    current = next;
                }
                else
                {
                    current = current.Next;
                }
                if (Items.Count == 0)
                {
                    break;
                }
            }
        }
        public async Task <IActionResult> GetQueueAzure()
        {
            await GetQueue.RegisterOnMessageHandlerAndReceiveMessages();

            return(Ok());
        }
Exemplo n.º 11
0
 public virtual void CancelWaiting(CraneScheduleStoreGet order)
 {
     GetQueue.Remove(order);
     TriggerGet();
 }