Esempio n. 1
0
        public async Task <ActionResult> Run(string queryName, CancellationToken token)
        {
            Response.StatusCode  = 200;
            Response.ContentType = "text/event-stream";

            var sw = new StreamWriter(Response.Body);

            _sqlQueryReader.Reload();
            await _runner.Run(queryName, token,
                              cnt =>
            {
                Response.ContentLength = cnt;
            },
                              async() =>
            {
                await sw.WriteAsync("1");
                await sw.FlushAsync();
            }
                              );

            return(Ok());
        }