Skip to content

Commit

Permalink
Send initial event after opening an SSE connection (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnotheis authored Jun 27, 2024
1 parent 18d7b8a commit 9bed394
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SseServer/src/SseServer/Controllers/SseController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ await _mediator.Send(new UpdateDeviceRegistrationCommand
{
_eventQueue.Register(address);

await streamWriter.SendServerSentEvent("ConnectionOpened");

await foreach (var eventName in _eventQueue.DequeueFor(address, HttpContext.RequestAborted))
{
await streamWriter.SendServerSentEvent(eventName);
Expand Down

0 comments on commit 9bed394

Please sign in to comment.