Blocking I/O
https://github.com/phpstreamserver/phpstreamserver/blob/main/src/Symfony/src/Http/AmpHttpFactory.php#L21
Thanks for highlighting this. The issue wasn't even blocking IO, but buffering itself. StreamedResponse was buffered and only flushed at the end, instead of streaming progressively. I've removed buffering, so the response now streams directly to the client as it's generated. Changes are here: https://github.com/phpstreamserver/phpstreamserver/commit/4da8bd4ee917e88455ad79b2fe4dd4d4bc0439f8.
Thanks for highlighting this. The issue wasn't even blocking IO, but buffering itself. StreamedResponse was buffered and only flushed at the end, instead of streaming progressively. I've removed buffering, so the response now streams directly to the client as it's generated. Changes are here: 4da8bd4.
It seems to me that the problem is much worse, in response itself echo is used, and echo is also a blocking I/O. So it's better to make separate responses, where there won't be such problems. Yes, it's BC, but there won't be any extra overhead.
I agree, a separate StreamedResponse that doesn't rely on echo under the hood could be a better option.
Or is there another option, to make a PR in symfony/http-foundation and isolate echo
P.S. By the way, we also encountered similar problems within the new RoadRunner + Symfony integration, so for now we decided to make separate responses.