fix(virtualstream): Fix handling of virtual streams for proper shutdown

This commit is contained in:
2024-10-14 00:13:28 +02:00
parent 03c7150b6b
commit 7b6fb9e9bc
5 changed files with 250 additions and 184 deletions

View File

@@ -380,7 +380,7 @@ export class VirtualStream<T = Uint8Array> implements plugins.typedRequestInterf
public async writeToWebstream(writableStreamArg: WritableStream<T>) {
const writer = writableStreamArg.getWriter();
while(this.keepAlive) {
while(this.keepAlive || this.receiveBackpressuredArray.checkHasItems()) {
await writer.write(await this.fetchData());
}
}