Skip to content

Commit

Permalink
Use EventSource_factory in open_stream() for Wasm (gradio-app#6820)
Browse files Browse the repository at this point in the history
* Use `EventSource_factory` in `open_stream()` for Wasm

* add changeset

---------

Co-authored-by: gradio-pr-bot <[email protected]>
Co-authored-by: Ali Abdalla <[email protected]>
  • Loading branch information
3 people authored Dec 30, 2023
1 parent a5f3d2b commit 649cd4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/short-clowns-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@gradio/client": minor
"gradio": minor
---

feat:Use `EventSource_factory` in `open_stream()` for Wasm
2 changes: 1 addition & 1 deletion client/js/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ export function api_factory(
session_hash: session_hash
}).toString();
let url = new URL(`${config.root}/queue/data?${params}`);
event_stream = new EventSource(url);
event_stream = EventSource_factory(url);
event_stream.onmessage = async function (event) {
let _data = JSON.parse(event.data);
const event_id = _data.event_id;
Expand Down

0 comments on commit 649cd4d

Please sign in to comment.