static void Main(string[] args) { var testQueueName = "test"; IMessageProduct product = new MessageProduct(testQueueName); for (int i = 0; i < 10000; i++) { Console.WriteLine("正在发送第" + i + "条消息..."); product.Publish("消息体" + i); } Console.Read(); }
/// <summary> /// Gets a new member for the list. /// </summary> /// <param name="m">The member to add. The message denotes how it is added. /// "Update" replaces at the specified index, "Add" adds it to the list.</param> public void ReceiveProduct(MessageProduct m) { if (m.Message == "Update") { products[products.IndexOf(SelectedProduct)] = m; database.SaveProducts(); } else if (m.Message == "Add") { products.Add(m); database.SaveProducts(); } }
static void Main(string[] args) { var testQueueName = "test"; IMessageProduct product = new MessageProduct(testQueueName); for (int i = 0; i < 10000; i++) { Console.WriteLine("正在发送第" + i + "条消息..."); product.Publish("消息体" + i); } Console.Read(); }
public IMessageProduct CreateProduct(string queueName) { IMessageProduct product; if (!Products.ContainsKey(queueName)) { product = new MessageProduct(queueName); Products.Add(queueName, product); } else { product = Products[queueName]; } return(product); }
public IMessageProduct CreateProduct(string queueName) { IMessageProduct product; if (!Products.ContainsKey(queueName)) { product = new MessageProduct(queueName); Products.Add(queueName, product); } else { product = Products[queueName]; } return product; }