问题
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