Skip to main content

run_socket_loop

Function run_socket_loop 

Source
async fn run_socket_loop(
    app_token: String,
    channel_id: String,
    target_agent: Option<String>,
    http: Client,
    health: Arc<Mutex<BridgeHealth>>,
)
Expand description

Outer retry-forever loop: fetch a fresh WS URL, run a session until it ends (cleanly or with an error), back off, repeat. Every attempt — initial connect included — fetches a new URL via apps.connections.open (spec §2.1: the URL is single-use, there is no Discord-style constant Gateway URL to fall back to).