Conversation
|
Hum! Very very very interesting. |
| } | ||
| } | ||
|
|
||
| if ($symfonyResponse instanceof BinaryFileResponse) { |
There was a problem hiding this comment.
This is inconsistent, right? I mean, if that response can be another thing but a Symfony Response, then is not $symfonyResponse but $response.
There was a problem hiding this comment.
BinaryFileResponse extends the Symfony response in the same way as StreamedResponse does.
See https://github.com/symfony/http-foundation/blob/master/StreamedResponse.php and https://github.com/symfony/http-foundation/blob/master/BinaryFileResponse.php
So both objects pass the method type hint but need different handling within the method to benefit from the streaming capabilities.
|
Just to mention again, this is a Work in Progress. There are no testes yet and I just have written some code how i think this could work. I have made a few first tests with a streamed response yesterday and something blocks forever. This is something I still need to fix. |
|
@Deltachaos great! Please, if you need any help, don't hesitate to ask me or to join the DriftPHP community and ask there - https://gitter.im/driftphp/community Thanks for your time and work :) |
|
@Deltachaos any updates on that? Thanks! |
|
@Deltachaos I merged this PR - 3ed8edb This commit covers
Only Symfony StreamedResponse is missing. Not a must but can be covered in the future. In the meanwhile, we can work properly with the PSR7 one. I close this PR cue to inactivity. |
|
@mmoreram nice! when i find some time i will add Symfony StreamedResponse |
An example how a implementation for streams could look like