Exemple #1
0
        public QueueActions GetQueue(string queueName)
        {
            QueueActions actions;

            if (queuesByName.TryGetValue(queueName, out actions))
            {
                return(actions);
            }

            var enumerator = queues.GetEnumerator(new StringValueIndex("pk", queueName));

            if (!enumerator.MoveNext())
            {
                throw new QueueDoesNotExistsException(queueName);
            }

            queuesByName[queueName] = actions =
                new QueueActions(session, dbid, queueName, GetSubqueues(queueName), this,
                                 i => AddToNumberOfMessagesIn(queueName, i));
            return(actions);
        }
        public QueueActions GetQueue(string queueName)
        {
            QueueActions actions;
            if (queuesByName.TryGetValue(queueName, out actions))
                return actions;

            var enumerator = queues.GetEnumerator(new StringValueIndex("pk", queueName));

            if(!enumerator.MoveNext())
                throw new QueueDoesNotExistsException(queueName);

            queuesByName[queueName] = actions =
                new QueueActions(session, dbid, queueName, GetSubqueues(queueName), this,
                    i => AddToNumberOfMessagesIn(queueName, i));
            return actions;
        }