Skip to content

Is it possible to handle streamed responses? #25

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
andig opened this issue Mar 18, 2016 · 3 comments
Closed

Is it possible to handle streamed responses? #25

andig opened this issue Mar 18, 2016 · 3 comments

Comments

@andig
Copy link
Contributor

andig commented Mar 18, 2016

Looking at https://github.com/php-pm/php-pm-httpkernel/blob/master/Bridges/HttpKernel.php#L142 we read the entire response and then send it on via react. Reading en-bloc is a very un-reactish thing to do but I have so far not found and good approach to read the response as its being delivered and pass on to react.

Any ideas?

@marcj
Copy link
Member

marcj commented Mar 18, 2016

When Symfony has a stream in the streamed response we could wrap it with a React Stream and assign it to HttpResponse (methods tbd) which is then checked and handled as stream in our HttpServer.

@andig
Copy link
Contributor Author

andig commented Mar 20, 2016

When Symfony has a stream in the streamed response we could wrap it with a React Stream and assign it to HttpResponse (methods tbd) which is then checked and handled as stream in our HttpServer.

Unfortunately, a StreamedResponse simply calls a user function to echo it's content: https://github.com/symfony/http-foundation/blob/master/StreamedResponse.php#L78. I didn't find an approach to make this an async process- I guess its not possible with this interface?

@marcj
Copy link
Member

marcj commented May 4, 2016

continue in #36

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

No branches or pull requests

2 participants