Пример #1
0
        public QueueActions GetQueue(string queueName)
        {
            QueueActions actions;

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

            Api.JetSetCurrentIndex(session, queues, "pk");
            Api.MakeKey(session, queues, queueName, Encoding.Unicode, MakeKeyGrbit.NewKey);

            if (Api.TrySeek(session, queues, SeekGrbit.SeekEQ) == false)
            {
                throw new QueueDoesNotExistsException(queueName);
            }


            queuesByName[queueName] = actions =
                new QueueActions(session, dbid, queueName, GetSubqueues(queueName), this,
                                 i => AddToNumberOfMessagesIn(queueName, i));
            return(actions);
        }
Пример #2
0
        public QueueActions GetQueue(string queueName)
        {
            QueueActions actions;
            if (queuesByName.TryGetValue(queueName, out actions))
                return actions;

            Api.JetSetCurrentIndex(session, queues, "pk");
            Api.MakeKey(session, queues, queueName, Encoding.Unicode, MakeKeyGrbit.NewKey);

            if (Api.TrySeek(session, queues, SeekGrbit.SeekEQ) == false)
                throw new QueueDoesNotExistsException(queueName);

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