Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
stream interface should provide destroy() method #5
The stream interface example in README.md uses node's Stream.pipe to send data to clarinet. Stream.pipe assumes that the destination stream (in this case clarinet) implements a destroy() method, which it invokes in the event of an abrupt close of the source stream.
This will happen, for example, if we are piping from a socket and the socket is abruptly disconnected. Since clarinet's stream does not provide destroy(), this chain results in an error in the global scope such as the following:
node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ TypeError: Object #<CStream> has no method 'destroy' at IncomingMessage.onclose (stream.js:98:10) at IncomingMessage.emit (events.js:88:20) at abortIncoming (http.js:1386:11) at Socket.<anonymous> (http.js:1459:5) at Socket.emit (events.js:88:20) at Array.0 (net.js:320:10) at EventEmitter._tickCallback (node.js:192:40)