Skip to content

lluchs/eventsource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EventSource

crates.io Documentation Build Status

EventSource is a Rust library for reading from Server-Sent Events endpoints. It transparently sends HTTP requests and only exposes a stream of events to the user. It handles automatic reconnection and parsing of the text/event-stream data format.

Examples

use eventsource::reqwest::Client;
use reqwest::Url;
                                                                                              
fn main() {
    let client = Client::new(Url::parse("http://example.com").unwrap());
    for event in client {
        println!("{}", event.unwrap());
    }
}

About

Rust client for the EventSource browser API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages