File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/react-server/src Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ type BunReadableStreamController = ReadableStreamController & {
13
13
end ( ) : mixed ,
14
14
write ( data : Chunk | BinaryChunk ) : void ,
15
15
error ( error : Error ) : void ,
16
+ flush ?: ( ) => void ,
16
17
} ;
17
18
export type Destination = BunReadableStreamController ;
18
19
@@ -25,8 +26,12 @@ export function scheduleWork(callback: () => void) {
25
26
}
26
27
27
28
export function flushBuffered ( destination : Destination ) {
28
- // WHATWG Streams do not yet have a way to flush the underlying
29
- // transform streams. https://github.com/whatwg/streams/issues/960
29
+ // Bun direct streams provide a flush function.
30
+ // If we don't have any more data to send right now.
31
+ // Flush whatever is in the buffer to the wire.
32
+ if ( typeof destination . flush === 'function' ) {
33
+ destination . flush ( ) ;
34
+ }
30
35
}
31
36
32
37
export function beginWriting ( destination : Destination ) { }
You can’t perform that action at this time.
0 commit comments