ssepulse.client

SsePulse.Client

SsePulse.Client is a .NET Server-Sent Events (SSE) client library for consuming real-time event streams with minimal boilerplate.It offers a fluent handler-registration API, strongly-typed JSON deserialization, pluggable authentication, configurable retry and reconnect logic, and an extensible request-mutator pipeline — everything you need to integrate SSE into any .NET application, from lightweight console tools to full ASP.NET Core services backed by Microsoft.Extensions.DependencyInjection.

Highlights

Quick start

var client = new HttpClient { BaseAddress = new Uri("https://my-sse-server.example") };
var options = new SseSourceOptions { Path = "/events" };

await using var source = new SseSource(client, options);

source
    .On<OrderCreated>((OrderCreated e) => Console.WriteLine($"Order {e.Id} created"))
    .On<OrderShipped>((OrderShipped e) => Console.WriteLine($"Order {e.Id} shipped"))
    .OnError(ex => Console.Error.WriteLine(ex));

await source.StartConsumeAsync(CancellationToken.None);