Final message in server events not being pushed until heartbeat

雨燕双飞 提交于 2019-12-12 10:48:40

问题


We are having an issue with the final message sent over service stack waiting until the next heart beat to be sent. We believe it to be similar to :

Servicestack server sent events

However, res.Write() is now deprecated and res.WriteAsync() throws:

System.InvalidOperationException: This operation cannot be performed after the response has been submitted

I have also tried to solve the issue stated in the above thread by using :

// Remove url compression https://stackoverflow.com/questions/53559038/asp-net-core-disable-response-decompression
// because of https://stackoverflow.com/questions/25960723/servicestack-server-sent-events
services.AddResponseCompression(options =>
{
    var gzip = options.Providers.OfType<GzipCompressionProvider>().FirstOrDefault();
    if (gzip != null)
    {
       options.Providers.Remove(gzip);
    }
});

Would appreciate a push in the correct direction to addressing this issue as the currently accepted solution to this issue is no longer viable.

来源:https://stackoverflow.com/questions/58165887/final-message-in-server-events-not-being-pushed-until-heartbeat

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!