Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

mtarld
Copy link
Contributor

@mtarld mtarld commented Apr 24, 2025

Q A
Branch? 7.3
Bug fix? yes
New feature? no
Deprecations? no
Issues
License MIT

The StreamedResponse doesn't flush after echoing. Therefore, all the chunks are kept in output buffer, which prevents proper streaming.

This PR triggers flushes after each echo.

@mtarld mtarld force-pushed the fix/flush-streamed-response branch from dfa336e to bf72397 Compare April 27, 2025 09:21
@fabpot
Copy link
Member

fabpot commented Apr 27, 2025

Thank you @mtarld.

@fabpot fabpot merged commit a2a47bc into symfony:7.3 Apr 27, 2025
9 of 11 checks passed
@xabbuh
Copy link
Member

xabbuh commented Apr 27, 2025

Should we update the class docblock now and remove the part about calling flush().

@chalasr
Copy link
Member

chalasr commented Apr 27, 2025

@xabbuh I don't think so. The added flush is only used by the callback that is created internally when the response is built with an iterable of content chunks, while that docblock suggests flushing from the user-defined callback you can pass instead of the chunks.

@mtarld mtarld deleted the fix/flush-streamed-response branch July 7, 2025 09:52
@mtarld mtarld restored the fix/flush-streamed-response branch July 7, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.