denoland / std

The Deno Standard Library
https://jsr.io/@std
MIT License
3.2k stars 620 forks source link

[http/server_sent_event] Missing ServerSentEventStreamTarget ReadableStream "open" event listener #3645

Closed ghost closed 12 months ago

ghost commented 1 year ago

Describe the bug

There's a close event for when the readableStream closes, so it's strange and inconsistent that there isn't a corresponding open or start stream event.

Furthermore, this.#bodyInit is declared as a private property so the class can't be extended. It has to be entirely duplicated to be usable.

** Context ***

I want to be able to send events to the client immediately after they connect, but it's not possible in a clean way due to the current limitations.

Environment

iuioiua commented 1 year ago

Hi @adamatat, ServerSentEvent() has been deprecated in favour of ServerSentEventStream(). See here. Are you able to give that a try and let us know how it goes?

iuioiua commented 12 months ago

Closing this as ServerSentEvent() was deprecated and is now removed. Please use ServerSentEventStream() and open an issue if you run into any problems.