Esempio n. 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());
        }
Esempio n. 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());
        }
Esempio n. 3
0
 public void End(IncomingCall call)
 => call.EndTime = DateTime.Now;