You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the data event and the stdout buffering compete for the same data. Users have to opt-out of stdout buffering by using the buffer: false option.
However, it does not have the be this way. The issue here is that get-stream uses Readable[Symbol.asyncIterator]. The default implementation relies on calling stream.read() repeatedly. This works but does not allow for multiple readers at once.
Instead, using stream.on('data') would allow for multiple readers at once. We should make get-stream use that instead.
Since get-stream supports not only Node.js Readable streams but any async iterable, this logic would only be used when a Node.js Readable stream is passed.
The text was updated successfully, but these errors were encountered:
When
get-stream
is used, other readers cannot be used at the same time.For example, this does not work (both calls will compete for the same data):
This creates some limitations for users. For example, in Execa, the following does not work:
Because the
data
event and thestdout
buffering compete for the same data. Users have to opt-out ofstdout
buffering by using thebuffer: false
option.However, it does not have the be this way. The issue here is that
get-stream
usesReadable[Symbol.asyncIterator]
. The default implementation relies on callingstream.read()
repeatedly. This works but does not allow for multiple readers at once.Instead, using
stream.on('data')
would allow for multiple readers at once. We should makeget-stream
use that instead.Since
get-stream
supports not only Node.jsReadable
streams but any async iterable, this logic would only be used when a Node.jsReadable
stream is passed.The text was updated successfully, but these errors were encountered: