Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

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

Closed
ghost opened this issue Aug 30, 2011 · 6 comments
Closed

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

ghost opened this issue Aug 30, 2011 · 6 comments
Labels

Comments

@ghost
Copy link

ghost commented Aug 30, 2011

Hi,

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
Copy link
Member

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

@ghost
Copy link
Author

ghost commented Aug 30, 2011

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

@ghost ghost closed this as completed Aug 30, 2011
@koichik
Copy link

koichik commented Aug 30, 2011

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

@tj
Copy link

tj commented Aug 30, 2011

I could definitely use a public "finish" in Connect

@ghost
Copy link
Author

ghost commented Aug 30, 2011

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

@tj
Copy link

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

No branches or pull requests

3 participants