Open hirschenberger opened 1 year ago
It seems ServerSentEvents::new
only takes one event name and Sse::new
only takes one ServerSentEvents
. Is it even possible to create a stream sending multiple events? You mentioned it's inefficient but I think it's actually impossible, or at least I haven't figured out how to do it.
It would be nice if one could open multiple SSE streams by using a path extractor in the SSE handler for each event type. So the diffing of the payload is more efficient.
like this:
Each component could provide it's own stream in it's context. Unfortunately here only the existence of the
ServerSignalEventSource
type is checked in the context and creation of a new stream is skipped if it already exists.Would be cool if we also compare the URL and create a new stream in the context, if the URL is different.