A stable package for the new System.Net.ServerSentEvents library isn't yet available, but until one is we can switch the code over to using a source copy.
The natural replacement for ServerSentEvent is SseItem<string>, but I used SseItem<byte[]> instead just to avoid an unnecessary UTF8->UTF16->UTF8 roundtrip. It could be taken further in the future to avoid allocation by doing more of the parsing inside of the callback passed to SseParser.
A stable package for the new System.Net.ServerSentEvents library isn't yet available, but until one is we can switch the code over to using a source copy.
The natural replacement for
ServerSentEvent
isSseItem<string>
, but I usedSseItem<byte[]>
instead just to avoid an unnecessary UTF8->UTF16->UTF8 roundtrip. It could be taken further in the future to avoid allocation by doing more of the parsing inside of the callback passed to SseParser.