示例#1
0
        public void Enqueue <T>(T command, DateTime datetime) where T : class, ICommand
        {
            var envelope = new CommandEnvelope {
                Command = command
            };

            _serviceBus.DelaySend(datetime, envelope);
        }
示例#2
0
        public void Enqueue <T>(T command) where T : class, ICommand
        {
            var envelope = new CommandEnvelope {
                Command = command
            };

            _bus.Send(envelope);
        }
示例#3
0
        public void Enqueue <T>(T command, TimeSpan delay) where T : class, ICommand
        {
            var envelope = new CommandEnvelope {
                Command = command
            };
            DateTime deliveryTime = DateTime.Now.Add(delay);

            _serviceBus.DelaySend(deliveryTime, envelope);
        }