-
-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sse): close sse stream on end (#2529)
* close sse stream on end Adds a finally block to the SSEStream class. Otherwise streamSSE will error whenever used in Cloudflare Workers. * denoify * add a test --------- Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
- Loading branch information
1 parent
c83d80f
commit 9f9a41c
Showing
3 changed files
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,8 @@ const run = async ( | |
} else { | ||
console.error(e) | ||
} | ||
} finally { | ||
stream.close() | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,8 @@ const run = async ( | |
} else { | ||
console.error(e) | ||
} | ||
} finally { | ||
stream.close() | ||
} | ||
} | ||
|
||
|