服务器事件中的最终消息直到心跳才被推送

Bar*_*rry 5 c# servicestack

通过服务堆栈发送的最终消息一直存在问题,一直等到要发送下一个心跳。我们认为它类似于:

Servicestack服务器发送事件

但是,现在不推荐使用res.Write(),并且res.WriteAsync()抛出:

System.InvalidOperationException: This operation cannot be performed after the response has been submitted
Run Code Online (Sandbox Code Playgroud)

我还尝试通过使用以下方法解决上述线程中所述的问题:

// 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);
    }
});
Run Code Online (Sandbox Code Playgroud)

希望朝正确的方向努力解决这个问题,因为当前接受的解决方案已不再可行。