Пример #1
0
        public DefaultTaskExecutionContext(TaskSession session, MazeTask mazeTask, IServiceProvider services, Func <CommandProcessDto, Task> updateStatus)
        {
            Session  = session;
            MazeTask = mazeTask;
            Services = services;

            _statusUpdate = new MessageThrottleService <CommandProcessDto>(updateStatus);
        }
Пример #2
0
        public void TestComputeDelay()
        {
            var result = MessageThrottleService <string> .ComputeDelay(TimeSpan.FromSeconds(1), TimeSpan.FromMinutes(1), 10);

            var result1 = MessageThrottleService <string> .ComputeDelay(TimeSpan.FromSeconds(1), TimeSpan.FromMinutes(1), 1);

            var result2 = MessageThrottleService <string> .ComputeDelay(TimeSpan.FromSeconds(1), TimeSpan.FromMinutes(1), 5);

            var result3 = MessageThrottleService <string> .ComputeDelay(TimeSpan.FromSeconds(1), TimeSpan.FromMinutes(1), 40);

            var result4 = MessageThrottleService <string> .ComputeDelay(TimeSpan.FromSeconds(1), TimeSpan.FromMinutes(1), 60);

            Console.WriteLine(result);
        }
Пример #3
0
 public DefaultTaskExecutionContext(IServiceProvider services, Func <CommandProcessDto, Task> updateStatus)
 {
     Services      = services;
     _statusUpdate = new MessageThrottleService <CommandProcessDto>(updateStatus);
 }