eventsource-stream

Crates.ioeventsource-stream
lib.rseventsource-stream
version0.2.3
sourcesrc
created_at2020-06-27 13:55:43.36161
updated_at2022-02-17 19:33:45.863426
descriptionA basic building block for building an Eventsource from a Stream of bytes
homepagehttps://github.com/jpopesculian/eventsource-stream
repositoryhttps://github.com/jpopesculian/eventsource-stream
max_upload_size
id258786
size60,010
Julian Popescu (jpopesculian)

documentation

https://docs.rs/eventsource-stream/

README

eventsource-stream

A basic building block for building an Eventsource from a Stream of bytes array like objects. To learn more about Server Sent Events (SSE) take a look at the MDN docs

Example

let mut stream = reqwest::Client::new()
    .get("http://localhost:7020/notifications")
    .send()
    .await?
    .bytes_stream()
    .eventsource();

while let Some(thing) = stream.next().await {
   println!("{:?}", thing);
}

License: MIT OR Apache-2.0

Commit count: 21

cargo fmt