The header information like the graph should also be sent as an event. It should be supported to have this change in the middle of a stream also.
Ideally tools can also deal with the header not being present, and recontructing information from data events (to the extent possible)
This way debugging tools can be live updated with changes to the system.
One possibility is to use
text/event-stream
format. It is a simple \n\n delimited format, with good support for JSON payloads. https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format It has the benefit of also being used in server-side-events which is supported by webbrowsers.The header information like the graph should also be sent as an event. It should be supported to have this change in the middle of a stream also. Ideally tools can also deal with the header not being present, and recontructing information from data events (to the extent possible)