aha-reqwest-eventsource

Crates.ioaha-reqwest-eventsource
lib.rsaha-reqwest-eventsource
version0.1.0
created_at2026-01-03 11:04:55.235527+00
updated_at2026-01-03 11:04:55.235527+00
descriptionHelper to build an Eventsource using reqwest. This is fork from jpopesculian/reqwest-eventsource
homepagehttps://github.com/xgpxg/reqwest-eventsource
repositoryhttps://github.com/xgpxg/reqwest-eventsource
max_upload_size
id2019919
size81,878
(xgpxg)

documentation

https://docs.rs/aha-reqwest-eventsource/

README

Forked from https://github.com/jpopesculian/reqwest-eventsource

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

Commit count: 0

cargo fmt