1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Real-time protocol engine: WebSocket gateways + Server-Sent Events.
//!
//! NestJS-Gateway ergonomics on a zero-cost, lock-free-on-the-hot-path Rust
//! core. Declare a gateway, subscribe to events, broadcast to rooms — without
//! ever naming an `axum`/`tower` type.
//!
//! ```ignore
//! #[Injectable]
//! pub struct ChatGateway { db: Inject<Db> }
//!
//! impl ArclyGateway for ChatGateway {
//! async fn on_connect(&self, client: WsClient) { client.join_room("lobby"); }
//! }
//!
//! #[Gateway("/chat-socket")]
//! impl ChatGateway {
//! #[Subscribe("message::send")]
//! async fn on_message(&self, client: WsClient, payload: Json<ChatMessage>)
//! -> Result<(), Error>
//! {
//! client.broadcast_to_room(&payload.room, "message::receive", &*payload).await;
//! Ok(())
//! }
//! }
//! ```
//!
//! See [`macros`] for the exact expansion contract and the rationale for the
//! `#[Gateway]`-on-impl placement.
pub use ;
pub use ;
pub use ;
pub use ws_route;
// Re-export the procedural macros so users write `arcly_http::realtime::Gateway`.
pub use ;