# `ExWapp.Session.Worker.Connection`
[🔗](https://github.com/elchemista/ex_wapp/blob/v0.1.5/lib/ex_wapp/session/worker/connection.ex#L1)

The session's connection lifecycle: opening the transport, reacting to what it
reports, tearing it down and deciding when to try again.

Everything here runs inside the session process — the worker calls these
functions, so the transport is linked to it, `Process.monitor/1` registers the
monitor against it and timers fire back into its mailbox, exactly as when this
code sat in `ExWapp.Session.Worker`. Nothing is moved to another process; only
the code moved out of the module.

Teardown is deliberately tolerant: a disconnect cancels timers, drains pending
callers and stops child processes, and each of those steps has to run even if
an earlier one found nothing to clean up.

# `clear_initial_sync_task`

# `connection_event_summary`

# `do_connect`

# `do_disconnect`

# `do_health_check`

# `ensure_connected_for_send`

# `fail_all_send_workers`

# `handle_connection_event`

# `handle_connection_exit`

# `reply_send_caller`

# `restart_connection_now`

# `restart_inbound_router`

# `restart_outbound_queue`

# `schedule_connect`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
