HTTP.ClientCompletion (http_core v1.0.0)

Copy Markdown View Source

Durable cleanup receipt returned by EventSource and WebSocket completion/1.

A finite wait confirms tracked request resources have terminated or been handed off to their retained HTTP/2 owner. Healthy shared connections stay open. Logical close, protocol acknowledgements and process death alone do not establish cleanup. Receipts remain readable after the client exits; repeated and concurrent waits are safe. Lost evidence is reported as unconfirmed.

This barrier does not certify native allocator or kernel memory reclamation, or remote receipt of application bytes. WebSocket over HTTP/3 confirms the CONNECT stream settled on its owner and, for an exclusive owner, native QUIC cleanup (see docs/http3-extensions-contract.md). EventSource over HTTP/3 remains explicitly unsupported by this receipt.

Summary

Functions

Waits for cleanup using one finite timeout in milliseconds.

Types

result()

@type result() ::
  :ok
  | {:error,
     :cleanup_pending | :cleanup_unconfirmed | {:unsupported_completion, atom()}}

t()

@opaque t()

Functions

await(receipt, timeout \\ 5000)

@spec await(t(), non_neg_integer()) :: result()

Waits for cleanup using one finite timeout in milliseconds.