Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Render: SSE limited to data field #1700
The current implementation of SSE in https://github.com/gobuffalo/buffalo/blob/master/render/sse.go encodes a "type" and "data" into a JSON object, and sends the string over the SSE connection in the format
Current SSE implementations would probably rely on parsing the JSON from a clientside
Are we interested in changing the implementation of SSE in render to allow more use of this feature? Without breaking existing applications, we would still have to rely on encoding into JSON with a redundant "type" field.
Something like this would allow a WriteWithEvent method to write the event and any normal data through the same Write method, which will also call the es.Flush() and similar things could be written for retry and id.
Please note I'm not really a developer and this might appear to be a horrible solution.