embedio icon indicating copy to clipboard operation
embedio copied to clipboard

How to report progess via api - event-stream

Open dos-ise opened this issue 2 years ago • 1 comments

Describe the bug I try to report progress for a long running operation. My implementation is based on how i would implment it on ASP.Net Core Unfortunately it does not work. How should I implement something like this for embedio?

**Desktop

  • OS: Windows
  • Browser Edge
  • Version 3.5.2.0
       [Route(HttpVerbs.Any, "/import")]
        public async Task ImportPrjAsync([QueryData] NameValueCollection parameters)
        {
            Response.StatusCode = 200;
            Response.ContentType = "text/event-stream";
            Response.ContentLength64 = 10;

            var sw = new StreamWriter(HttpContext.Response.OutputStream);
            for (var i = 0; i < 10; i++)
            {
                await Task.Delay(1000);
                await sw.WriteAsync("1");
                await sw.FlushAsync();
            }
        }

dos-ise avatar Oct 20 '23 07:10 dos-ise

Did you ever manage to get progress reporting to work?

mcrossley avatar Dec 18 '24 11:12 mcrossley