- Version: 5.7.1
- Platform: all
- Subsystem: streams
It says here to ignore unnecessary end() calls. That means callbacks will not fire, even though end() is called. Should it not instead return either an error to the callback, or act as a noop before calling cb? The irony is that endWritable itself seems to act exactly like it may be called multiple times.
So which should it be? Right now, it seems like we have 2 different pieces of reasoning in the same class, and one simply overrules the other. Imho, we should get rid of one, and in my opinion, it should be the "ignore unnecessary end() calls" one, because when people pass a callback, they expect it to be called.
It says here to ignore unnecessary end() calls. That means callbacks will not fire, even though end() is called. Should it not instead return either an error to the callback, or act as a noop before calling cb? The irony is that endWritable itself seems to act exactly like it may be called multiple times.
So which should it be? Right now, it seems like we have 2 different pieces of reasoning in the same class, and one simply overrules the other. Imho, we should get rid of one, and in my opinion, it should be the "ignore unnecessary end() calls" one, because when people pass a callback, they expect it to be called.