Skip to content

Support Symfony StreamedResponse again #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 2 tasks
andig opened this issue May 1, 2016 · 1 comment
Closed
1 of 2 tasks

Support Symfony StreamedResponse again #36

andig opened this issue May 1, 2016 · 1 comment
Labels

Comments

@andig
Copy link
Contributor

andig commented May 1, 2016

Ever since 8e2554e StreamedResponses are no longer working since in https://github.com/php-pm/php-pm-httpkernel/blob/master/Bridges/HttpKernel.php#L173 $content will be false. Instead or additionally, a call to syResponse->sendContent() is needed.

However, since StreamedResponses can become huge, their output should rather be parsed in a streamed way instead of just concatenating to a buffer.

@marcj any idea how this could be done, i.e. ob_get_contents() in a streamed way? Like capturing our own STDOUT to a readable stream? Also, the contents should be piped on to the ReactReponse immediately.

  • add StreamedResponse back in
  • push/pull in async manner
@andig
Copy link
Contributor Author

andig commented May 2, 2016

@marcj any idea how this could be done, i.e. ob_get_contents() in a streamed way? Like capturing our own STDOUT to a readable stream? Also, the contents should be piped on to the ReactReponse immediately.

Regarding that I think the only available option is to use ReactReponse ->write() instead of ReactReponse ->end() in https://github.com/php-pm/php-pm-httpkernel/blob/master/Bridges/HttpKernel.php#L243. This will still need the full response to be stored in memory of the php-cgi process but might make it possible to push bits of it down to the client already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant