Comments (3)
That's a good question, but I'm not sure this is a good thing to do. For example, there would be no guarantee that one of things are being used on the steam unless there is a way that can be checked in the implementation here before emitting it?
There are all kinds of things that can do things on an event, and emitting it on something we don't understand could cause other code to trigger incorrectly, especially if the stream already closed the underlying resource and emitted close and now this module emitted it a second time?
from destroy.
An example of where this can be an issue I see in just the first streams doc for Writable
https://nodejs.org/dist/latest-v10.x/docs/api/stream.html#stream_event_close
The 'close' event is emitted when the stream and any of its underlying resources (a file descriptor, for example) have been closed. The event indicates that no more events will be emitted, and no further computation will occur.
It would seem that if this module emitted it a second time on a Writable, that would violate the API guarantees of the stream, making using this module more unsafe than it should be.
from destroy.
Makes sense. Thanks for looking into this.. Let's just close this issue 😃
from destroy.
Related Issues (3)
- better docs HOT 2
- do not destroy IncommingMessage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from destroy.