public void ProcessMessage(SharedMessage message)
        {
            if (message.MessageType == MessageType.Slow)
            {
                throw new Exception("Not supported");
            }

            Console.WriteLine("Processing (fast) {0}", message);
            Thread.Sleep(1000);
        }
Exemple #2
0
        public void ProcessMessage(SharedMessage message)
        {
            if (message.MessageType == MessageType.Slow)
            {
                throw new Exception("Not supported");
            }

            Console.WriteLine("Processing (fast) {0}", message);
            Thread.Sleep(1000);
        }
Exemple #3
0
        public void ProcessMessage(SharedMessage message)
        {
            Console.WriteLine("Processing (slow) {0}", message);

            var messageProcessingTime = message.MessageType == MessageType.Slow
                ? 50000
                : 1000;

            if (message.MessageType == MessageType.Slow)
            {
                Console.WriteLine("starting slow message " + message.Id);
            }

            Thread.Sleep(messageProcessingTime);

            if (message.MessageType == MessageType.Slow)
            {
                Console.WriteLine("finishing slow message " + message.Id);
            }
        }