mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-14 00:00:15 +02:00
Mention tokio-stream in SSE example
This commit is contained in:
@@ -50,6 +50,9 @@ async fn sse_handler(
|
||||
println!("`{}` connected", user_agent.as_str());
|
||||
|
||||
// A `Stream` that repeats an event every second
|
||||
//
|
||||
// You can also create streams from tokio channels using the wrappers in
|
||||
// https://docs.rs/tokio-stream
|
||||
let stream = stream::repeat_with(|| Event::default().data("hi!"))
|
||||
.map(Ok)
|
||||
.throttle(Duration::from_secs(1));
|
||||
|
||||
Reference in New Issue
Block a user