Expand description
Embedded SSE and WebSocket hub with topic-based pub/sub, authorization, cross-instance Redis relay, and connection lifecycle management.
Re-exports§
pub use auth::AuthContext;pub use auth::AuthRule;pub use auth::Policy;pub use auth::TopicAuth;pub use hub::BextHub;pub use hub::HubConfig;pub use hub::HubStatsSnapshot;pub use hub::Subscriber;pub use message::ClientMessage;pub use message::HubEvent;pub use message::ServerMessage;pub use sse::SseStream;pub use stats::format_json;pub use stats::format_prometheus;pub use topic::TopicFilter;pub use topic::TopicMatcher;pub use ws::WsSession;pub use ws::WsSessionConfig;
Modules§
- auth
- Topic-level authorization policies and rules for the realtime pub/sub hub.
- hub
- Core pub/sub hub that manages subscribers, topic subscriptions, event broadcasting, and replay buffers for the realtime subsystem.
- message
- Wire types for the realtime hub:
HubEvent(server-originated),ClientMessage(subscribe/publish from clients), andServerMessage(responses). - sse
- SSE (Server-Sent Events) byte stream adapter that formats
HubEvents into the SSE text protocol with periodic heartbeat keep-alive comments. - stats
- Hub statistics formatting: Prometheus text exposition and JSON representations of connection counts, event throughput, and per-topic metrics.
- topic
- Topic matching with MQTT-style wildcards.
- ws
- WebSocket session management: handles ping/pong heartbeats, JSON-framed client messages (subscribe, unsubscribe, publish), and server push delivery.