Esempio n. 1
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);
        }
Esempio n. 2
0
 public void Handle(DeplayedSend <T> order)
 {
     _list.Add(new KeyValuePair <DeplayedSend <T>, DateTime>(order, DateTime.Now.Add(order.Delay)));
 }