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;
 }
Exemple #2
0
        public virtual FilterStoreGet Get(Func <object, bool> filter = null)
        {
            var get = new FilterStoreGet(Environment, TriggerPut, filter ?? TrueFunc);

            GetQueue.AddLast(get);
            TriggerGet();
            return(get);
        }
 protected virtual void DoGet(FilterStoreGet get) {
   for (int i = 0; i < Items.Count; i++) {
     var item = Items[i];
     if (!get.Filter(item)) continue;
     Items.RemoveAt(i);
     get.Succeed(item);
     return;
   }
 }
Exemple #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);
        }
Exemple #5
0
 protected virtual void DoGet(FilterStoreGet get)
 {
     for (int i = 0; i < Items.Count; i++)
     {
         var item = Items[i];
         if (!get.Filter(item))
         {
             continue;
         }
         Items.RemoveAt(i);
         get.Succeed(item);
         return;
     }
 }
Exemple #6
0
 protected virtual void DoGet(FilterStoreGet get)
 {
     for (int i = 0; i < Items.Count; i++)
     {
         var item = Items[i];
         if (!get.Filter(item.Item))
         {
             continue;
         }
         GetWaitingTime?.Add(Environment.ToDouble(Environment.Now - get.Time));
         LeadTime?.Add(Environment.ToDouble(Environment.Now - item.AdmissionDate));
         Items.RemoveAt(i);
         get.Succeed(item.Item);
         return;
     }
 }