Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Could http.ServerResponse emit a "end" event ? #1611

ghost opened this Issue Aug 30, 2011 · 6 comments


None yet
3 participants

ghost commented Aug 30, 2011


I think that http.ServerResponse should emit a "end" (or something else) event to indicate that the response is done.

Why do I need this ?
Because I am in the case where I need to post files to the server. I would like to automatically remove uploaded files if not handled by the application.
That's why if there were a "end" event, I could remove files without being worried about if they are still needed by the application.

Generally, I think that is would be useful to know when the request is done.


bnoordhuis commented Aug 30, 2011

I think you're looking for the 'finish' event?


ghost commented Aug 30, 2011

Oooh, yep.
I should better read the code than the doc...

@ghost ghost closed this Aug 30, 2011

koichik commented Aug 30, 2011

Note that 'finish' is a private event.
joyent#1169 (comment)

tj commented Aug 30, 2011

I could definitely use a public "finish" in Connect


ghost commented Aug 30, 2011

Why it should not be used if it exists ? What is the problem of adding a listener ?

tj commented Aug 30, 2011

because it might disappear if it's not documented as public api. you can get around it by proxying the res.end() calls etc but this would be a lot less of a hack

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment