mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-20 00:00:11 +02:00
Add constructor to Sse (#244)
I think this is more consistent with the rest of the API
This commit is contained in:
@@ -8,7 +8,7 @@ use axum::{
|
||||
extract::TypedHeader,
|
||||
handler::get,
|
||||
http::StatusCode,
|
||||
response::sse::{sse, Event, Sse},
|
||||
response::sse::{Event, Sse},
|
||||
Router,
|
||||
};
|
||||
use futures::stream::{self, Stream};
|
||||
@@ -59,5 +59,5 @@ async fn sse_handler(
|
||||
.map(Ok)
|
||||
.throttle(Duration::from_secs(1));
|
||||
|
||||
sse(stream)
|
||||
Sse::new(stream)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user