Exemple #1
0
        public virtual ResourcePoolRequest Request(Func <object, bool> filter = null)
        {
            var request = new ResourcePoolRequest(Environment, TriggerRelease, DisposeCallback, filter ?? TrueFunc);

            RequestQueue.AddLast(request);
            TriggerRequest();
            return(request);
        }
 protected virtual void DoRequest(ResourcePoolRequest request) {
   foreach (var o in Resources) {
     if (!request.Filter(o)) continue;
     Resources.Remove(o);
     request.Succeed(o);
     return;
   }
 }
Exemple #3
0
 protected virtual void DoRequest(ResourcePoolRequest request)
 {
     foreach (var o in Resources)
     {
         if (!request.Filter(o))
         {
             continue;
         }
         Resources.Remove(o);
         request.Succeed(o);
         return;
     }
 }
Exemple #4
0
 protected virtual void DoRequest(ResourcePoolRequest request)
 {
     foreach (var o in Resources)
     {
         if (!request.Filter(o))
         {
             continue;
         }
         WaitingTime?.Add(Environment.ToDouble(Environment.Now - request.Time));
         Resources.Remove(o);
         request.Succeed(o);
         return;
     }
 }
 public virtual ResourcePoolRequest Request(Func<object, bool> filter = null) {
   var request = new ResourcePoolRequest(Environment, TriggerRelease, DisposeCallback, filter ?? TrueFunc);
   RequestQueue.AddLast(request);
   TriggerRequest();
   return request;
 }