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

Release the holder if the response has finished #17

Merged
merged 2 commits into from
Jan 20, 2018
Merged

Release the holder if the response has finished #17

merged 2 commits into from
Jan 20, 2018

Conversation

delvedor
Copy link
Member

As titled.

@delvedor delvedor requested a review from mcollina January 20, 2018 16:15
@delvedor delvedor mentioned this pull request Jan 20, 2018
4 tasks
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM. Is this affecting benchmarks at all?

@delvedor
Copy link
Member Author

@mcollina I didn't check, but since we are adding just an if condition (which is just a boolean check) it should not affect the performances.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

This should be documented somewhere. Also, what would happen if next() is called twice or after release().

@delvedor
Copy link
Member Author

Also, what would happen if next() is called twice or after release().

If you call twice next() you will get Cannot read property 'originalUrl' of null.

This should be documented somewhere.

Document what?
If a previous middleware calls res.end the next one will never run? Shouldn't this be implicit? 🤔

@mcollina
Copy link
Member

mcollina commented Jan 20, 2018 via email

@delvedor delvedor merged commit 4897ab8 into master Jan 20, 2018
@delvedor delvedor deleted the release branch January 20, 2018 16:49
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.

2 participants