Exemple #1
0
        public int Call(int clientId, bool isPriority = false)
        {
            var call = new IncomingCall
            {
                Id       = ++_counter,
                ClientId = clientId,
                CallTime = DateTime.Now,
            };

            (Calls as ConcurrentQueue <IncomingCall>).Enqueue(call);

            return(Calls.Count());
        }
Exemple #2
0
        public int Call(int clientId, bool isPriority = false)
        {
            var call = new IncomingCall
            {
                Id         = ++_counter,
                ClientId   = clientId,
                CallTime   = DateTime.Now,
                IsPriority = isPriority,
            };

            (Calls as SimplePriorityQueue <IncomingCall>).Enqueue(call, isPriority ? 0 : 1);

            return(Calls.Count());
        }
Exemple #3
0
 public void End(IncomingCall call)
 => call.EndTime = DateTime.Now;