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