Expand description
Slack messaging bridge — Socket Mode WebSocket receive + Web API send.
Lifecycle:
SlackBridge::init_global(config, http)— call once at startup.- The Socket Mode loop (inbound) and the outbound send loop run in the
background as two independent tokio tasks joined by
socket::run_bridge— see that module’s doc comment for why they’re split rather than interleaved (mirrorstelegram/poller.rs). SlackBridge::get()returns the singleton for HTTP handler use.bridge.send(msg)enqueues a message for the REST client.bridge.health()returns the current connection status.
Unlike Discord’s fixed Gateway URL, Slack’s Socket Mode WS URL is
ephemeral and single-use — a fresh URL is fetched via
apps.connections.open before every connection attempt (initial connect
and every reconnect), inside the spawned background task. init_global
itself does no network I/O and returns immediately, matching Discord’s
and Telegram’s synchronous, non-blocking init.
Modules§
- rest
- Slack Web API REST client —
apps.connections.open(Socket Mode URL fetch) +chat.postMessagefor outbound delivery. - socket 🔒
- Slack Socket Mode connection lifecycle:
apps.connections.open, the hello/events_api/disconnect-warning state machine, per-event ACK, the make-before-break reconnect-on-warning dance, and the 5-minute dead-connection timer — plus the outboundchat.postMessagesender. - types
- Slack Socket Mode + Web API wire types.