mirror of
https://github.com/Djeeberjr/fw-anwesenheit.git
synced 2026-05-03 03:31:56 +00:00
implemented SSE
This commit is contained in:
@@ -4,7 +4,6 @@ use picoserve::{
|
||||
response::{self, IntoResponse},
|
||||
};
|
||||
use serde::Deserialize;
|
||||
|
||||
use crate::{
|
||||
store::{Name, hex_string_to_tally_id},
|
||||
webserver::{app::AppState, sse::IDEvents},
|
||||
@@ -40,3 +39,7 @@ pub async fn add_mapping(
|
||||
let tally_id = hex_string_to_tally_id(&data.id).unwrap();
|
||||
store.mapping.add_mapping(tally_id, data.name);
|
||||
}
|
||||
|
||||
pub async fn get_idevent(State(state): State<AppState>) -> impl IntoResponse{
|
||||
response::EventStream(IDEvents(state.chan.subscriber().unwrap()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user