Skip to main content

run_outbound_loop

Function run_outbound_loop 

Source
async fn run_outbound_loop(
    config: WhatsAppConfig,
    http: Client,
    window_state: Arc<Mutex<HashMap<String, u64>>>,
    outbound_rx: UnboundedReceiver<OutboundMsg>,
)
Expand description

Drains the outbound mpsc queue and calls the Graph API for each message. Runs as its own tokio::spawned task, fully independent of the axum request tasks servicing webhook::handle_inbound — a slow or rate-limited send here cannot block the webhook route from accepting Meta’s next delivery (see module doc comment).