Repository navigation
Fix #115 - buffer each StreamedResponse chunk when sending data to swoole worker output - #116
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
alexander-schranz
left a comment
There was a problem hiding this comment.
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! |
…ng data to swoole worker output (php-runtime#116) * Fix php-runtime#115 - buffer each `StreamedResponse` chunk when sending 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 * Disabled error handler replacement, which is implicitly done by the `GenericRuntime` We don't want to replace the error handler: PHPUnit is good enough. This should bring the tests back to green too. * Upgrade PHPUnit configuration to comply with latest `phpunit.xsd` Ref: https://github.com/sebastianbergmann/phpunit/blob/f61e897412fe831831462c0698a6208f7d8298f0/phpunit.xsd#L255 Ref: https://github.com/sebastianbergmann/phpunit/blob/f61e897412fe831831462c0698a6208f7d8298f0/phpunit.xsd#L16-L20
This change ensures that, when converting a
StreamedResponseto 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
StreamedResponseListenerwhen working with this package.Fixes #115