MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / global_event_stream

Function global_event_stream

crates/opencode-server/src/routes.rs:3974–3982  ·  view source on GitHub ↗
(
    State(state): State<Arc<ServerState>>,
)

Source from the content-addressed store, hash-verified

3972}
3973
3974async fn global_event_stream(
3975 State(state): State<Arc<ServerState>>,
3976) -> Sse<impl Stream<Item = std::result::Result<Event, Infallible>>> {
3977 let rx = state.event_bus.subscribe();
3978 Sse::new(BroadcastStream::new(rx).filter_map(|result| match result {
3979 Ok(event) => Some(Ok(Event::default().data(event))),
3980 Err(_) => None,
3981 }))
3982}
3983
3984async fn get_global_config(State(_state): State<Arc<ServerState>>) -> Result<Json<AppConfig>> {
3985 Ok(Json(AppConfig::default()))

Callers

nothing calls this directly

Calls 2

newFunction · 0.85
subscribeMethod · 0.45

Tested by

no test coverage detected