# `SSL.Lifecycle`
[🔗](https://github.com/gsmlg-dev/http_fetch/blob/v0.21.18/apps/ex_ssl/lib/ssl/lifecycle.ex#L1)

Provider lifecycle evidence and transferable cancellation authority.

Create a handle before connecting and pass `{handle, lease}` under
`ex_ssl: [lifecycle: ...]`. A successful cancel accepts retirement; only a
confirmed await receipt establishes local resource cleanup. Control deadlines
are finite absolute monotonic milliseconds. Handles contain no cancellation
authority and remain readable after the provider exits.

# `accept`

```elixir
@spec accept(SSL.Lifecycle.Transfer.t(), {:abs_ms, integer()}) :: term()
```

# `await`

```elixir
@spec await(SSL.Lifecycle.Handle.t(), {:abs_ms, integer()}) :: term()
```

# `cancel`

```elixir
@spec cancel(SSL.Lifecycle.Lease.t(), {:abs_ms, integer()}) :: :ok | {:error, atom()}
```

# `new`

```elixir
@spec new(keyword()) ::
  {:ok, SSL.Lifecycle.Handle.t(), SSL.Lifecycle.Lease.t()} | {:error, atom()}
```

# `offer`

```elixir
@spec offer(
  SSL.Lifecycle.Lease.t(),
  %{controller: pid(), owner: pid()},
  {:abs_ms, integer()}
) :: term()
```

# `setup_failure`

```elixir
@spec setup_failure(SSL.Lifecycle.Handle.t()) ::
  {:ok, %{phase: :tls_setup}} | :unknown
```

Reads authenticated fatal setup-phase evidence separately from resource cleanup.

A proven result means the original Connection accepted ServerHello and committed
a fatal setup failure within its original deadline. The fixed result survives
provider exit. Missing or uncommitted evidence returns `:unknown`; cancellation,
timeout, and a successful handshake alone do not establish this phase.
Use `await/2` separately to establish local resource cleanup.

# `status`

```elixir
@spec status(SSL.Lifecycle.Handle.t()) ::
  {:pending, map()} | {:terminal, map()} | {:unconfirmed, atom()}
```

# `status`

```elixir
@spec status(SSL.Lifecycle.Handle.t(), {:abs_ms, integer()}) :: term()
```

Observes exact live resource counts within one finite absolute deadline.

---

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