eventsource-stream
eventsource-stream copied to clipboard
A basic building block for building an Eventsource from a Stream of bytes array like objects
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