calvinmetcalf / async-iter-stream

streams as asyncIterators
MIT License
9 stars 2 forks source link

http IncomingMessage is not a Readable #2

Closed mcollina closed 7 years ago

mcollina commented 7 years ago

We would need to provide an implementation also for streams 1.

calvinmetcalf commented 7 years ago

is there any prior art on effectively/efficiently doing read(function (err, data){}) on streams across versions?

mcollina commented 7 years ago

https://nodejs.org/api/stream.html#stream_readable_wrap_stream

calvinmetcalf commented 7 years ago

would the absence of readable.wrap be a good test to see if it's a streams1 ?

mcollina commented 7 years ago

I think we can just check if it has a _readableState.

calvinmetcalf commented 7 years ago

done in the wrap method