Quiver.Pool.HTTP2 (quiver v0.2.0)

Copy Markdown View Source

HTTP/2 connection pool coordinator.

A gen_state_machine per origin that routes concurrent callers to available stream slots across one or more HTTP/2 connection workers. Opens new connections when all existing ones are at max_concurrent_streams. Queues callers when the connection count is also at the maximum.

The coordinator uses a two-phase caller model:

  1. Caller sends a gen_statem call to the coordinator (checkout phase).
  2. Coordinator forwards the request to a connection worker via message.
  3. The connection worker replies directly to the caller's from reference.

Summary

Types

t()

@type t() :: %Quiver.Pool.HTTP2{
  checkout_timeout: pos_integer(),
  config: map() | nil,
  connections: map(),
  max_connections: pos_integer(),
  origin: term(),
  waiting: :queue.queue()
}

Functions

connected(arg1, arg2, data)

idle(arg1, arg2, data)

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

Starts the HTTP/2 pool coordinator.