Emit one or more SSE events and flush the stream. Event is one of:
- An atom or string. Shorthand for emitting a single event with
just a `data:` field, splitting the text on line breaks.
- A dict with any of the optional keys
event, data, id,
retry and comment. Unknown keys raise a domain_error/2.
event (atom or string) becomes one `event:` line.
id (atom, string or integer) becomes one `id:` line.
retry (non-negative integer) becomes one `retry:` line.
comment (atom, string or list) becomes one or more :
lines (an SSE comment) before the rest of the event.
data may be an atom, string, integer or list. Atoms and
strings are split on \n (with an optional \r) so that
multi-line text becomes multiple `data:` lines. A list is
taken to be a list of lines (which should not themselves
contain newlines).
- A list of any combination of the above. The whole list is
flushed once at the end.
The empty event (a dict containing none of the recognised keys) is
not allowed and raises a domain_error/2.