-
-
Notifications
You must be signed in to change notification settings - Fork 34
Fix #115 - buffer each StreamedResponse
chunk when sending data to swoole worker output
#116
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
Conversation
…ng data to swoole worker output This change ensures that, when converting a `StreamedResponse` to output within `php-runtime/swoole`, the output is streamed chunk-by-chunk, instead of being buffered in its entirety, and then being sent out to the swooler server all in one shot. This should fix some obvious performance, latency and memory issues related to streaming common responses assembled by PHP-side processes. Note: you will still need to disable symfony's `StreamedResponseListener` when working with this package. Ref: php-runtime#115
9aa355f
to
a19eccb
Compare
…GenericRuntime` We don't want to replace the error handler: PHPUnit is good enough. This should bring the tests back to green too.
The last deprecation that seems to make CI fail is caused by Because the parent class != child class, this code leads to a deprecation error:
Overall, that's not fixable in this library. EDIT: suggestion: disable symfony's deprecation system, and just use |
6e844a4
to
5be78a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks fine from my point of view. But I'm not familiar enough with the error_handler
. But it seems only effecting phpunit tests not application itself?
The tests deprecations which are thrown in the CI were also before there so not related to your PR changes.
Yes, that's because of the runner modifying global state in an unclean way. TBH, reminds me that I have to disable that error handler for my own use-cases as well :) |
Going to release this on a fork meanwhile, to allow for local usage on my end. |
@alexander-schranz I see this is approved - anything else to be done to get it through, to a release? |
Thanks @alexander-schranz! |
Is some automation needed to cut |
@Ocramius Was missing some permissions. Now 0.3.1 is tagged! |
Awesome, thanks! |
This change ensures that, when converting a
StreamedResponse
to output withinphp-runtime/swoole
,the output is streamed chunk-by-chunk, instead of being buffered in its entirety, and then being
sent out to the swooler server all in one shot.
This should fix some obvious performance, latency and memory issues related to streaming common responses
assembled by PHP-side processes.
Note: you will still need to disable symfony's
StreamedResponseListener
when working with this package.Fixes #115