8000 [HttpFoundation][Runtime] Add $flush parameter to Response::send() by fancyweb · Pull Request #52047 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpFoundation][Runtime] Add $flush parameter to Response::send() #52047

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” 8000 , 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

Merged

Conversation

fancyweb
Copy link
Contributor
@fancyweb fancyweb commented Oct 13, 2023
Q A
Branch? 6.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT

Inspired by #51912 and #45205 subjects

Adds optional argument $flush to Response::send(). If $flush === false, output buffers are not flushed/*_finish_request() and alike functions are not called.

We leverage that in the Runtime component by not flushing the output buffers when debug mode is on in order to see exceptions thrown in listeners listening on the TerminateEvent and also to feel a more "real" processing time of things happening on terminate.

nicolas-grekas
nicolas-grekas previously approved these changes Oct 13, 2023
Copy link
Member
@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Difficult to test, anyway, LGTM!

@fancyweb fancyweb force-pushed the runtime/do-not-finish-request-in-debug branch from 17a5728 to be1e3bc Compare October 16, 2023 14:33
@nicolas-grekas nicolas-grekas added the ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" label Oct 16, 2023
@fancyweb fancyweb force-pushed the runtime/do-not-finish-request-in-debug branch from be1e3bc to 1cf9000 Compare October 16, 2023 15:32
Copy link
Member
@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW @dunglas : does frankenphp provide an equivalent to fastcgi_finish_request()?

@dunglas
Copy link
Member
dunglas commented Oct 17, 2023

Yes, it implements the function: dunglas/frankenphp#69

@fancyweb fancyweb force-pushed the runtime/do-not-finish-request-in-debug branch from 1cf9000 to 8da05da Compare October 17, 2023 06:06
@fancyweb fancyweb force-pushed the runtime/do-not-finish-request-in-debug branch from 8da05da to a3304cc Compare October 18, 2023 07:11
@fancyweb fancyweb changed the title [Runtime] Do not call fastcgi_finish_request() when debug mode is on [HttpFoundation] Add $flush parameter to Response::send() Oct 18, 2023
@carsonbot carsonbot changed the title [HttpFoundation] Add $flush parameter to Response::send() [HttpFoundation][Runtime] Add $flush parameter to Response::send() Oct 18, 2023
@nicolas-grekas
Copy link
Member

Thank you @fancyweb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature HttpFoundation Runtime ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" Status: Reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0