Skip to main content

Crate anycms_event_actix

Crate anycms_event_actix 

Source
Expand description

Actix-web integration for anycms-event.

Provides state management, extractors, and optional SSE endpoint support.

§Quick Start

ⓘ
use anycms_event::EventBus;
use anycms_event_actix::{init_event_bus, EventBusExtractor};

let bus = EventBus::new();
let data = init_event_bus(bus);

HttpServer::new(move || {
    App::new()
        .app_data(data.clone())
        .route("/events", web::get().to(events_handler))
})

Structs§

EventBusExtractor
Extractor that yields an Arc<EventBus> from Actix app_data.

Traits§

HasEventBus
Trait for types that expose an inner EventBus.

Functions§

init_event_bus
Initialize EventBus for use with Actix-web.