jpopesculian/reqwest-eventsource

Helper to build an Eventsource using reqwest

Rust

71

19 commits

updated Jun 13, 2024

See the code

README

reqwest-eventsource

Provides a simple wrapper for [reqwest] to provide an Event Source implementation. You can learn more about Server Sent Events (SSE) take a look at the MDN docs This crate uses [eventsource_stream] to wrap the underlying Bytes stream, and retries failed requests.

Example

let mut es = EventSource::get("http://localhost:8000/events");
while let Some(event) = es.next().await {
    match event {
        Ok(Event::Open) => println!("Connection Open!"),
        Ok(Event::Message(message)) => println!("Message: {:#?}", message),
        Err(err) => {
            println!("Error: {}", err);
            es.close();
        }
    }
}

License: MIT OR Apache-2.0

async
event
eventsource
reqwest
rust
sse
stream

jpopesculian/reqwest-eventsource

Helper to build an Eventsource using reqwest

Rust

71

19 commits

updated Jun 13, 2024

See the code

README

reqwest-eventsource

Provides a simple wrapper for [reqwest] to provide an Event Source implementation. You can learn more about Server Sent Events (SSE) take a look at the MDN docs This crate uses [eventsource_stream] to wrap the underlying Bytes stream, and retries failed requests.

Example

let mut es = EventSource::get("http://localhost:8000/events");
while let Some(event) = es.next().await {
    match event {
        Ok(Event::Open) => println!("Connection Open!"),
        Ok(Event::Message(message)) => println!("Message: {:#?}", message),
        Err(err) => {
            println!("Error: {}", err);
            es.close();
        }
    }
}

License: MIT OR Apache-2.0

async
event
eventsource
reqwest
rust
sse
stream

Project health

Overall

2.5/10

Maintained

0/10

Code review

1/10
OpenSSF Scorecard

Latest release

0.6.0 · Mar 29, 2024

Releases this year

0

Significant stargazers

Kévin Dunglas

4,629 followers · starred Feb 2022

Emmanuel Leblond

208 followers · starred May 2023

Lev Kokotov

289 followers · starred Aug 2023

Rijk van Zanten

968 followers · starred Sep 2025