SSL.Lifecycle (ex_ssl v0.21.19)

Copy Markdown View Source

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.

Summary

Functions

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

Observes exact live resource counts within one finite absolute deadline.

Functions

accept(arg1, deadline)

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

await(arg1, deadline)

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

cancel(arg1, deadline)

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

new(options)

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

offer(arg1, target, deadline)

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

setup_failure(arg1)

@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(arg1)

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

status(arg1, deadline)

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

Observes exact live resource counts within one finite absolute deadline.