Skip to content
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

StreamedResponse not supported in Roadrunner #50

Open
alexander-schranz opened this issue May 21, 2021 · 4 comments
Open

StreamedResponse not supported in Roadrunner #50

alexander-schranz opened this issue May 21, 2021 · 4 comments

Comments

@alexander-schranz
Copy link
Member

More as a reference here currently there is no way to use a StreamedResponse inside roadrunner. This is because things output with echo, var_dump, flush or any other php internal method is not supported by roadrunner and is in this case ignored.

The issue on the roadrunner side is here: https://github.com/spiral/roadrunner/issues/2.

@Baldinof
Copy link

Baldinof commented Jun 2, 2021

Hi, I think I can give a little help here.

RoadRunner does not support streaming the responses, it means PSR responses streams are just consumed entirely and sent as one payload to RR.

StreamedResponse are well handled on the PsrHttpFactory side.

The problem is that Symfony setups a StreamedResponseListener which consumes the stream before PsrHttpFactory.

I handled this by disabling the Symfony listener when running in RR: https://github.com/Baldinof/roadrunner-bundle/blob/2.x/src/Integration/Symfony/StreamedResponseListener.php

@Ocramius
Copy link
Contributor

Ocramius commented Feb 14, 2022

FWIW, StreamedResponse doesn't seem to work with swoole either 🤔

Errata: bitten by StreamedResponseListener, which operates also under swoole :|

@alexander-schranz
Copy link
Member Author

Adding here a reference to #116 as when implementing this for roadrunner we should also keep that in mind.

@alexander-schranz
Copy link
Member Author

alexander-schranz commented Mar 16, 2022

Looks good that roadrunner 2.9 will bring us streaming responses: roadrunner-server/roadrunner#923 (comment)

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

No branches or pull requests

3 participants