Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to report progess via api - event-stream #587

Open
dos-ise opened this issue Oct 20, 2023 · 0 comments
Open

How to report progess via api - event-stream #587

dos-ise opened this issue Oct 20, 2023 · 0 comments

Comments

@dos-ise
Copy link

dos-ise commented Oct 20, 2023

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();
            }
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant