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); } }
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(); }