Destroy the stream. Optionally emit an 'error' event, and emit a 'close' event (unless emitClose is set to false). After this call, the writable
stream has ended and subsequent calls to write() or end() will result in
an ERR_STREAM_DESTROYED error.
This is a destructive and immediate way to destroy a stream. Previous calls to write() may not have drained, and may trigger an ERR_STREAM_DESTROYED error.
Use end() instead of destroy if data should flush before close, or wait for
the 'drain' event before destroying the stream.
Once destroy() has been called any further calls will be a no-op and no
further errors except from _destroy() may be emitted as 'error'.
Implementors should not override this method,
but instead implement writable._destroy().
Destroy the stream. Optionally emit an
'error'
event, and emit a'close'
event (unlessemitClose
is set tofalse
). After this call, the writable stream has ended and subsequent calls towrite()
orend()
will result in anERR_STREAM_DESTROYED
error. This is a destructive and immediate way to destroy a stream. Previous calls towrite()
may not have drained, and may trigger anERR_STREAM_DESTROYED
error. Useend()
instead of destroy if data should flush before close, or wait for the'drain'
event before destroying the stream.Once
destroy()
has been called any further calls will be a no-op and no further errors except from_destroy()
may be emitted as'error'
.Implementors should not override this method, but instead implement
writable._destroy()
.