示例#1
0
        static void Main(string[] args)
        {
            if (!MessageQueue.Exists(IncreaseQueueName))
                MessageQueue.Create(IncreaseQueueName, true);
            if (!MessageQueue.Exists(DecreaseQueueName))
                MessageQueue.Create(DecreaseQueueName, true);

            IncreaseThread increase = new IncreaseThread();
            increase.Start();
            DecreaseThread decrease = new DecreaseThread();
            decrease.Start();

            Console.WriteLine("Processing messages from the queue.");
            Console.ReadKey();

            increase.Stop();
            decrease.Stop();
        }
示例#2
0
        static void Main(string[] args)
        {
            if (!MessageQueue.Exists(IncreaseQueueName))
            {
                MessageQueue.Create(IncreaseQueueName, true);
            }
            if (!MessageQueue.Exists(DecreaseQueueName))
            {
                MessageQueue.Create(DecreaseQueueName, true);
            }

            IncreaseThread increase = new IncreaseThread();

            increase.Start();
            DecreaseThread decrease = new DecreaseThread();

            decrease.Start();

            Console.WriteLine("Processing messages from the queue.");
            Console.ReadKey();

            increase.Stop();
            decrease.Stop();
        }