Skip to content

Commit 36d5e9a

Browse files
committed
Add abort signal to stream controller
1 parent 304d7c6 commit 36d5e9a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

types/streams.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ declare global {
7373
/** The amount of data the consumer wants, or null if the stream is closed. */
7474
readonly desiredSize: number | null;
7575

76+
/**
77+
* An AbortSignal that is aborted when the stream consumer cancels/disconnects.
78+
* Use this to detect client disconnection and stop producing data.
79+
*/
80+
readonly signal?: AbortSignal;
81+
7682
/** Closes the stream. No more chunks can be enqueued after this. */
7783
close(): void;
7884

0 commit comments

Comments
 (0)