Exemplo n.º 1
0
        public string BasicConsume(string queue,
                                   bool noAck,
                                   string consumerTag,
                                   bool noLocal,
                                   bool exclusive,
                                   IDictionary filter,
                                   IBasicConsumer consumer)
        {
            ModelShutdown += new ModelShutdownEventHandler(consumer.HandleModelShutdown);

            BasicConsumerRpcContinuation k = new BasicConsumerRpcContinuation();

            k.m_consumer = consumer;

            Enqueue(k);
            // Non-nowait. We have an unconventional means of getting
            // the RPC response, but a response is still expected.
            try
            {
                _Private_BasicConsume(queue, consumerTag, noLocal, noAck, exclusive,
                                      /*nowait:*/ false, filter);
            }
            catch (AlreadyClosedException)
            {
                // Ignored, since the continuation will be told about
                // the closure via an OperationInterruptedException because
                // of the shutdown event propagation.
            }
            k.GetReply();
            string actualConsumerTag = k.m_consumerTag;

            return(actualConsumerTag);
        }
Exemplo n.º 2
0
        public void BasicCancel(string consumerTag)
        {
            BasicConsumerRpcContinuation k = new BasicConsumerRpcContinuation();

            k.m_consumerTag = consumerTag;

            Enqueue(k);

            try
            {
                _Private_BasicCancel(consumerTag, false);
            }
            catch (AlreadyClosedException)
            {
                // Ignored, since the continuation will be told about
                // the closure via an OperationInterruptedException because
                // of the shutdown event propagation.
            }

            k.GetReply();

            ModelShutdown -= new ModelShutdownEventHandler(k.m_consumer.HandleModelShutdown);
        }
Exemplo n.º 3
0
        public void BasicCancel(string consumerTag)
        {
            BasicConsumerRpcContinuation k = new BasicConsumerRpcContinuation();
            k.m_consumerTag = consumerTag;

            Enqueue(k);

            _Private_BasicCancel(consumerTag, false);
            k.GetReply();

            ModelShutdown -= new ModelShutdownEventHandler(k.m_consumer.HandleModelShutdown);
        }
Exemplo n.º 4
0
        public string BasicConsume(string queue,
                                   bool noAck,
                                   string consumerTag,
                                   bool noLocal,
                                   bool exclusive,
                                   IDictionary<string, object> arguments,
                                   IBasicConsumer consumer)
        {
            ModelShutdown += new ModelShutdownEventHandler(consumer.HandleModelShutdown);

            BasicConsumerRpcContinuation k = new BasicConsumerRpcContinuation();
            k.m_consumer = consumer;

            Enqueue(k);
            // Non-nowait. We have an unconventional means of getting
            // the RPC response, but a response is still expected.
            _Private_BasicConsume(queue, consumerTag, noLocal, noAck, exclusive,
                                  /*nowait:*/ false, arguments);
            k.GetReply();
            string actualConsumerTag = k.m_consumerTag;

            return actualConsumerTag;
        }
Exemplo n.º 5
0
        public string BasicConsume(string queue,
            bool autoAck,
            string consumerTag,
            bool noLocal,
            bool exclusive,
            IDictionary<string, object> arguments,
            IBasicConsumer consumer)
        {
            var k = new BasicConsumerRpcContinuation { m_consumer = consumer };

            Enqueue(k);
            // Non-nowait. We have an unconventional means of getting
            // the RPC response, but a response is still expected.
            _Private_BasicConsume(queue, consumerTag, noLocal, autoAck, exclusive,
                /*nowait:*/ false, arguments);
            k.GetReply(this.ContinuationTimeout);
            string actualConsumerTag = k.m_consumerTag;

            return actualConsumerTag;
        }
Exemplo n.º 6
0
        public void BasicCancel(string consumerTag)
        {
            var k = new BasicConsumerRpcContinuation { m_consumerTag = consumerTag };

            Enqueue(k);

            _Private_BasicCancel(consumerTag, false);
            k.GetReply(this.ContinuationTimeout);
            lock (m_consumers)
            {
                m_consumers.Remove(consumerTag);
            }

            ModelShutdown -= k.m_consumer.HandleModelShutdown;
        }
Exemplo n.º 7
0
        public string BasicConsume(string queue,
                                   bool noAck,
                                   string consumerTag,
                                   bool noLocal,
                                   bool exclusive,
                                   IDictionary<string, object> arguments,
                                   IBasicConsumer consumer)
        {
            ModelShutdown += new ModelShutdownEventHandler(consumer.HandleModelShutdown);

            BasicConsumerRpcContinuation k = new BasicConsumerRpcContinuation();
            k.m_consumer = consumer;

            Enqueue(k);
            // Non-nowait. We have an unconventional means of getting
            // the RPC response, but a response is still expected.
            try
            {
                _Private_BasicConsume(queue, consumerTag, noLocal, noAck, exclusive,
                    /*nowait:*/ false, arguments);
            }
            catch (AlreadyClosedException)
            {
                // Ignored, since the continuation will be told about
                // the closure via an OperationInterruptedException because
                // of the shutdown event propagation.
            }
            k.GetReply();
            string actualConsumerTag = k.m_consumerTag;

            return actualConsumerTag;
        }
Exemplo n.º 8
0
        public void BasicCancel(string consumerTag)
        {
            BasicConsumerRpcContinuation k = new BasicConsumerRpcContinuation();
            k.m_consumerTag = consumerTag;

            Enqueue(k);

            try
            {
                _Private_BasicCancel(consumerTag, false);
            }
            catch (AlreadyClosedException)
            {
                // Ignored, since the continuation will be told about
                // the closure via an OperationInterruptedException because
                // of the shutdown event propagation.
            }

            k.GetReply();

            ModelShutdown -= new ModelShutdownEventHandler(k.m_consumer.HandleModelShutdown);
        }