Skip to content
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

Flush alias #74

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

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?

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants