Crates.io | eventsource-stream |
lib.rs | eventsource-stream |
version | 0.2.3 |
source | src |
created_at | 2020-06-27 13:55:43.36161 |
updated_at | 2022-02-17 19:33:45.863426 |
description | A basic building block for building an Eventsource from a Stream of bytes |
homepage | https://github.com/jpopesculian/eventsource-stream |
repository | https://github.com/jpopesculian/eventsource-stream |
max_upload_size | |
id | 258786 |
size | 60,010 |
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
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