I just learned about SSE and it seems each article is explaining SSE using an interval to write data to the stream.
isn't that going to cost more cpu and memory? especially that each request to the server is going to create another async function that is constantly checking for data change.
how can I trigger a stream-write whenever a database write has been made or something similar that is more precise?
how do I associate the session id with the actual user? can I include a cookie in the request?