feat(smartduplex): improve backpressure handling and web/node stream interoperability
This commit is contained in:
@@ -6,8 +6,11 @@ export class StreamIntake<T> extends plugins.stream.Readable {
|
||||
const intakeStream = new StreamIntake<U>(options);
|
||||
|
||||
if (inputStream instanceof plugins.stream.Readable) {
|
||||
inputStream.on('data', (chunk: U) => {
|
||||
intakeStream.pushData(chunk);
|
||||
inputStream.on('readable', () => {
|
||||
let chunk: U;
|
||||
while (null !== (chunk = inputStream.read() as U)) {
|
||||
intakeStream.pushData(chunk);
|
||||
}
|
||||
});
|
||||
|
||||
inputStream.on('end', () => {
|
||||
|
||||
Reference in New Issue
Block a user