# `Ankusa.BlobStore.Pool`
[🔗](https://github.com/jamescarr/ankusa/blob/ankusa-v0.7.0/packages/ankusa/lib/ankusa/blob_store/pool.ex#L1)

The connection pool of each HTTP object store's endpoint, owned by the
instance (`Ankusa.Instance` starts one [`Finch`](https://hex.pm/packages/finch)
per distinct endpoint of `storage.blob_store`, `backup.blob_store`,
`backup.secondary` and `claim_check.blob_stores`).

Req's default pool is one shared Finch with 50 connections for every origin
the VM talks to: under claim-check load it is the throughput ceiling, and a slow
bucket takes connections from every other client. A pool per endpoint is sized
by the store's options (`pool_size` connections, `pool_count` pools,
`pool_timeout` ms to check one out; see `Ankusa.BlobStore.Options`), so a
slow bucket exhausts its own pool and no other. Stores that share an endpoint
share the pool, sized by the largest of them.

The pool carries the transport: TLS peer verification (TLS 1.2/1.3, the system
trust store, or the store's `req_options` `cacertfile`), the connect timeout
(`timeout_ms`) and the store's `connect_options`. A store that names its own
transport (`req_options: [finch: [name: MyFinch]]`, or `plug:` in tests) gets no pool.

# `child_specs`

```elixir
@spec child_specs(Ankusa.Config.t()) :: [Supervisor.child_spec()]
```

Child specs of the pools `config`'s stores need, one per distinct endpoint.

# `name`

```elixir
@spec name(atom(), String.t()) :: atom()
```

The name of `instance`'s pool for `endpoint`.

# `req_options`

```elixir
@spec req_options(atom(), String.t(), keyword()) :: keyword()
```

The `:req_options` a request to `endpoint` is sent with: the store's own, plus
`finch:` this instance's pool for the endpoint (and `pool_timeout`) when that
pool is running. A store that names its own transport is left alone.

---

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