Esempio n. 1
0
        public void Handle(RetryCooking order)
        {
            if (_isCooked)
            {
                return;
            }

            StartCooking(order, order.Order);
        }
Esempio n. 2
0
        private void StartCooking(MessageBase message, JObject order)
        {
            var cookFood = new CookFood {
                Order = order
            };

            cookFood.ReplyTo(message);
            _publisher.Publish(cookFood);

            var retryMessage = new RetryCooking {
                Order = order
            };

            retryMessage.ReplyTo(message);
            var delayedMessage = new DeplayedSend <RetryCooking>
            {
                Message = retryMessage,
                Delay   = TimeSpan.FromSeconds(10)
            };

            delayedMessage.ReplyTo(message);
            _publisher.Publish(delayedMessage);
        }