protected virtual void TriggerRelease(Event @event = null) { while (ReleaseQueue.Count > 0) { var release = ReleaseQueue.Peek(); if (release.Request.IsAlive) { if (!RequestQueue.TryRemove(release.Request)) { throw new InvalidOperationException("Failed to cancel a request."); } release.Succeed(); ReleaseQueue.Dequeue(); } DoRelease(release); if (release.IsTriggered) { ReleaseQueue.Dequeue(); TriggerWhenAny(); TriggerWhenFull(); TriggerWhenChange(); } else { break; } } }
protected virtual void TriggerRelease(Event @event = null) { while (ReleaseQueue.Count > 0) { var release = ReleaseQueue.Peek(); if (release.Request.IsAlive) { if (!RequestQueue.Remove(release.Request)) { throw new InvalidOperationException("Failed to cancel a request."); } BreakOffTime?.Add(Environment.ToDouble(Environment.Now - release.Request.Time)); release.Succeed(); ReleaseQueue.Dequeue(); } else { DoRelease(release); if (release.IsTriggered) { ReleaseQueue.Dequeue(); TriggerWhenAny(); TriggerWhenFull(); TriggerWhenChange(); } else { break; } } } Utilization?.UpdateTo(InUse / (double)Capacity); WIP?.UpdateTo(InUse + RequestQueue.Count); QueueLength?.UpdateTo(RequestQueue.Count); }
protected virtual void TriggerRelease(Event @event = null) { while (ReleaseQueue.Count > 0) { var release = ReleaseQueue.Peek(); DoRelease(release); if (release.IsTriggered) { ReleaseQueue.Dequeue(); } else { break; } } }
protected override void TriggerRelease(Event @event = null) { while (ReleaseQueue.Count > 0) { var release = ReleaseQueue.Peek(); this.DoRelease(release); if (release.Request.IsTriggered) { ReleaseQueue.Dequeue(); } else { break; } } }