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; }
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; } }
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); }
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; } }
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; } }