Exemple #1
0
        public async Task <HandlerResponse> OnCommand(ExampleAsyncCommand command)
        {
            await Task.Run(() =>
            {
                Thread.Sleep(command.Seconds * 1000);
            });

            return(new HandlerResponse
            {
                ResponseMessage = command.Message + " - with handler response. "
            });
        }
Exemple #2
0
        public Task <HandlerResponse> PostAsyncCommand([FromBody] CommandInfo info)
        {
            var cmd = new ExampleAsyncCommand(info);

            return(_messagingSrv.PublishAsync(cmd));
        }