# `HTTP.HTTP2.Pool`
[🔗](https://github.com/gsmlg-dev/http_fetch/blob/v1.0.0-rc.9/apps/http_pool/lib/http/http2/pool.ex#L1)

Bounded profile-aware HTTP/2 connection pool.

# `key`

```elixir
@type key() :: term()
```

# `reservation`

```elixir
@type reservation() :: reference()
```

# `cancel`

```elixir
@spec cancel(pid(), reservation()) :: :ok | {:error, :unknown_reservation}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `claim_connect`

```elixir
@spec claim_connect(pid(), key()) :: :start | :wait
```

Claims the per-key connection slot for an out-of-band connector.

# `complete_connect`

```elixir
@spec complete_connect(pid(), key()) :: :ok
```

Settles a successful non-H2 negotiation and lets queued requests negotiate in turn.

# `fail_connect`

```elixir
@spec fail_connect(pid(), key(), term()) :: :ok
```

Fails an out-of-band connection attempt and wakes queued reservations.

# `mark_draining`

```elixir
@spec mark_draining(pid(), key(), pid()) :: :ok
```

Stops new reservations on an owner that received GOAWAY.

# `register`

```elixir
@spec register(pid(), key(), pid(), keyword()) ::
  :ok | {:error, :connector_cancelled | :owner_closed | :connection_capacity}
```

# `release`

```elixir
@spec release(pid(), key(), reservation()) :: :ok
```

# `reserve`

```elixir
@spec reserve(pid(), key(), keyword()) ::
  {:ok, pid(), reservation()} | {:connect, reservation()} | {:error, term()}
```

Atomically reserves one stream slot for `key`.

# `start_link`

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

# `stats`

```elixir
@spec stats(pid()) :: map()
```

# `try_reserve`

```elixir
@spec try_reserve(pid(), key()) :: {:ok, pid(), reservation()} | :none
```

Reserves an available stream without queueing or starting a connection.

# `update_capabilities`

```elixir
@spec update_capabilities(pid(), key(), pid(), map()) ::
  :ok | {:error, :unknown_owner | :invalid_capabilities}
```

Updates capability observed in valid peer SETTINGS for one connection.

# `update_capacity`

Updates one owner's effective peer stream limit.

---

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