Example #1
0
        public void GetLength()
        {
            string queueName = "SubmitOrder";

            LtQueueService.LtQueueClient client = new LtQueueService.LtQueueClient();

            LtQueueService.QueueModel ret = client.QueueLength(queueName);

            if (ret.Value != null)
            {
                Debug.WriteLine(ret.Value);
            }
            else
            {
                Debug.WriteLine(ret.ErrorMessage);
            }
        }
Example #2
0
        public void Queue()
        {
            string queueName = "SubmitOrder";

            LtQueueService.LtQueueClient client = new LtQueueService.LtQueueClient();

            LtQueueService.QueueModel ret = client.Dequeue(queueName);

            if (ret.Status == 1)
            {
                TaskQueue taskQueue = JsonConvert.DeserializeObject <TaskQueue>(ret.Value.ToString());

                Debug.WriteLine(taskQueue.Value);

                Debug.WriteLine("出队成功");
            }
            else
            {
                Debug.WriteLine(ret.ErrorMessage);
            }
        }
Example #3
0
        public void TestMethod1()
        {
            string queueName = "SubmitOrder";

            LtQueueService.LtQueueClient client = new LtQueueService.LtQueueClient();

            TaskQueue taskQueue = GetLastTaskQueue();

            LtQueueService.QueueModel ret = client.Enqueue(queueName, JsonConvert.SerializeObject(taskQueue));
            bool success = (bool)ret.Value;

            if (success)
            {
                Console.WriteLine("入队成功");
            }
            else
            {
                Console.WriteLine(ret.ErrorMessage);
            }

            ret = client.Dequeue(queueName);

            if (ret.Status == 1)
            {
                Console.WriteLine(ret.Value.ToString());

                Console.WriteLine("出队成功");
            }
            else
            {
                Console.WriteLine(ret.ErrorMessage);
            }



            Console.ReadLine();
        }