feat: Sse server auto ping (#74)

1. auto ping in sse stream every second to make cursor happy
2. configurable sse keep alive

---------

Co-authored-by: = <=>
This commit is contained in:
4t145 2025-04-01 10:54:09 +08:00 • committed by GitHub
commit 923e87af4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,6 +24,7 @@ async fn main() -> anyhow::Result<()> {
sse_path: "/sse".to_string(),
post_path: "/message".to_string(),
ct: tokio_util::sync::CancellationToken::new(),
sse_keep_alive: None,
};
let (sse_server, router) = SseServer::new(config);