Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.
/ EvtSource Public archive

Server-Sent Events client implementation for .net core

License

Notifications You must be signed in to change notification settings

3ventic/EvtSource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EvtSource

A .net core client library for server-sent events.

Available from nuget as 3v.EvtSource.

Usage Example

var evt = new EventSourceReader(new Uri("https://example.com/some/url/to/SSE")).Start();
evt.MessageReceived += (object sender, EventSourceMessageEventArgs e) => Console.WriteLine($"{e.Event} : {e.Message}");
evt.Disconnected += async (object sender, DisconnectEventArgs e) => {
    Console.WriteLine($"Retry: {e.ReconnectDelay} - Error: {e.Exception}");
    await Task.Delay(e.ReconnectDelay);
    evt.Start(); // Reconnect to the same URL
};

About

Server-Sent Events client implementation for .net core

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages