Skip to content

Flush alias #74

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

Closed
wants to merge 3 commits into from
Closed

Flush alias #74

wants to merge 3 commits into from

Conversation

gigabo
Copy link

@gigabo gigabo commented Feb 17, 2016

Hi,

This adds res.flushCompression() as an alias for res.flush()

This supports use such as:

// Not going to write again for a while.  If compression middleware is
// installed let's tell it to flush what we've got through to the client.
if (res.flushCompression) {
    res.flushCompression();
}

Currently the res object has a flush method regardless of whether compression middleware is installed. The built-in flush method issues a noisy deprecation warning. This patch provides an alias for the flush method to allow detection of the compression middleware's flush.

This addresses #72.

Thanks,

Bo

@rexxars
Copy link

rexxars commented Jun 26, 2016

This would help me as well - any feedback on this @dougwilson?

gigabo added 3 commits June 27, 2016 16:01
Supports use such as:

```javascript
// Not going to write again for a while.  If compression middleware is
// installed let's tell it to flush what we've got through to the client.
if (res.flushCompression) {
    res.flushCompression();
}
```

Currently the `res` object has a `flush` method regardless of whether
compression middleware is installed.  The built-in `flush` method issues a
noisy deprecation warning.  This patch provides an alias for the `flush`
method to allow detection of the compression middleware's `flush`.

This addresses expressjs#72.
@wKovacs64
Copy link

This would be nice. Any chance of a quick review, @dougwilson?

@dougwilson
Copy link
Contributor

In parallel, we can probably think of a good way to indicate if the response is getting compressed in a unique way that is obvious and doesn't conflict too much (darn Node.js taking res.flush() ;) ).

@dougwilson dougwilson modified the milestone: 2.0 Jan 6, 2017
@dougwilson dougwilson self-assigned this Feb 11, 2017
@dougwilson dougwilson added the pr label Feb 11, 2017
@dougwilson dougwilson force-pushed the master branch 3 times, most recently from d7bb81b to cd957aa Compare May 30, 2018 04:09
@bjohansebas bjohansebas removed the pr label Apr 7, 2025
@bjohansebas
Copy link
Member

bjohansebas commented Apr 7, 2025

I'm not sure about adding this property, I'll ping on Slack in case anyone has feedback to share.

cc: @expressjs/express-tc

@bjohansebas bjohansebas self-requested a review April 7, 2025 19:14
@bjohansebas bjohansebas self-assigned this Apr 7, 2025
@bjohansebas
Copy link
Member

.flush is no longer a method on HTTP OutgoingMessage, so this method is no longer needed

https://nodejs.org/api/deprecations.html#dep0001-httpoutgoingmessageprototypeflush

@bjohansebas bjohansebas closed this Apr 7, 2025
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

Successfully merging this pull request may close these issues.

5 participants