public async Task <HandlerResponse> OnCommand(ExampleAsyncCommand command) { await Task.Run(() => { Thread.Sleep(command.Seconds * 1000); }); return(new HandlerResponse { ResponseMessage = command.Message + " - with handler response. " }); }
public Task <HandlerResponse> PostAsyncCommand([FromBody] CommandInfo info) { var cmd = new ExampleAsyncCommand(info); return(_messagingSrv.PublishAsync(cmd)); }