async Task <IServerSentEventsClient> IServerSentEventsClient.Start()
        {
            IServerSentEventsClient @this = this;

            m_eventStreamProcessor.OnMessage = message =>
            {
                @this.OnMessage?.Invoke(message);
                if (m_eventListeners.TryGetValue(message.Event, out var handlers))
                {
                    foreach (var handler in handlers)
                    {
                        handler.Invoke(message);
                    }
                }
            };

            using (m_logger.BeginScope("Stratring SSE client")) {
                m_logger.LogInformation("Configuring HttpClient");
                @this.Configure?.Invoke(m_eventStreamClient.HttpClient);

                m_logger.LogInformation("Connecting...");

                Stream stream;
                try {
                    stream = await m_eventStreamClient.StartAsync().ConfigureAwait(false);
                }
                catch (Exception e) {
                    m_logger.LogError(0, e, "Failed to connect");
                    throw;
                }

                m_cts = new CancellationTokenSource();
#pragma warning disable 4014
                // Fire & forget
                m_eventStreamProcessor.ProcessAsync(stream, m_cts.Token);
#pragma warning restore 4014
                m_logger.LogInformation("Processing SSE stream has started");
            }

            return(this);
        }
 public void ProcessAsync_NoOnMessageHandler_ShoudntThrow()
 {
     Assert.DoesNotThrowAsync(async() => await m_sut.ProcessAsync(new MemoryStream(), CancellationToken.None));
 }