예제 #1
0
        public List <Tuple <string, long> > GetQueueInfo()
        {
            List <Tuple <string, long> > result = new List <Tuple <string, long> >();

            lock (_syncLocker)
            {
                var list = _messageQueue.ToList();
                if (list != null)
                {
                    var tlts = list.Select(b => b.Topic).Distinct().ToList();

                    if (tlts != null)
                    {
                        foreach (var topic in tlts)
                        {
                            var count = _messageQueue.GetCount(topic);
                            var t     = new Tuple <string, long>(topic, count);
                            result.Add(t);
                        }
                        tlts.Clear();
                    }
                    list.Clear();
                }
            }
            return(result);
        }
예제 #2
0
        public List <Tuple <string, long> > GetQueueInfo()
        {
            List <Tuple <string, long> > result = new List <Tuple <string, long> >();
            var dic = _messageQueue.ToList();

            if (!dic.IsEmpty)
            {
                foreach (var item in dic)
                {
                    var count = _messageQueue.GetCount(item.Key);
                    var t     = new Tuple <string, long>(item.Key, count);
                    result.Add(t);
                }
            }
            return(result);
        }