Exemplo n.º 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);
        }
Exemplo n.º 2
0
 protected virtual void DoRequest(ResourcePoolRequest request) {
   foreach (var o in Resources) {
     if (!request.Filter(o)) continue;
     Resources.Remove(o);
     request.Succeed(o);
     return;
   }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 5
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;
 }