Lines Matching refs:stream
18 const eos = require('internal/streams/end-of-stream');
22 // This method is inlined here for readable-stream
23 // It also does not allow for signal to not exist on the stream
32 module.exports.addAbortSignal = function addAbortSignal(signal, stream) {
34 if (!isNodeStream(stream) && !isWebStream(stream)) {
35 throw new ERR_INVALID_ARG_TYPE('stream', ['ReadableStream', 'WritableStream', 'Stream'], stream);
37 return module.exports.addAbortSignalNoValidate(signal, stream);
40 module.exports.addAbortSignalNoValidate = function(signal, stream) {
42 return stream;
44 const onAbort = isNodeStream(stream) ?
46 stream.destroy(new AbortError(undefined, { cause: signal.reason }));
49 stream[kControllerErrorFunction](new AbortError(undefined, { cause: signal.reason }));
56 eos(stream, disposable[SymbolDispose]);
58 return stream;