fix docker stream backpressure (#1445)
This commit is contained in:
1 parent
a485c8580b
commit
ca2cb80c3f
3 files changed
+87
-24
No files matched your search
@@ -0,0 +1,9 @@
|
||||
import { Readable } from 'node:stream';
|
||||
|
||||
/**
|
||||
* Convert a Node readable to a Web stream while preserving Node backpressure.
|
||||
* Cancellation and source errors are forwarded by Node's native adapter.
|
||||
*/
|
||||
export function toWebReadableStream(source: Readable): ReadableStream<Uint8Array> {
|
||||
return Readable.toWeb(source) as ReadableStream<Uint8Array>;
|
||||
}
|
||||
Reference in new issue
Block a user