Finch adapter for HTTPower.
This adapter uses the Finch HTTP client library to make HTTP requests. Finch is a performance-focused HTTP client built on Mint and NimblePool, with explicit connection pooling and excellent performance characteristics.
Features
- High-performance HTTP/1.1 and HTTP/2 support
- Explicit connection pooling with configurable pool sizes
- Built on Mint for low-level HTTP transport
- Pool-level SSL/TLS and proxy configuration
Configuration
The Finch adapter honors these per-request options:
timeout- Receive timeout in seconds (converted to milliseconds for Finch)pool_timeout- Max time in milliseconds to wait to check out a pooled connection (defaults to Finch's own default of 5000 when not set)
Per-request ssl_verify and proxy are not supported
Finch configures TLS verification and proxy at the pool level (baked in
at Finch.start_link), not per request — Finch.request/3 has no
connection options. Passing ssl_verify: or proxy: per request has no
effect with this adapter; configure them on the pool instead (below).
HTTPower's built-in default pool pins verify: :verify_peer explicitly, so
certificates are verified by default regardless of the backend's own
default (Mint supplies the system CA store). The Req and Tesla adapters
honor these options differently — see their docs.
Pool Configuration
Configure Finch pools — including TLS and proxy — globally in your
application config (these flow straight into Finch's :pools):
config :httpower, :finch_pools,
default: [
size: 10,
count: System.schedulers_online(),
conn_opts: [
transport_opts: [verify: :verify_peer],
proxy: {:http, "proxy.example.com", 8080, []}
]
]Testing
The Finch adapter works seamlessly with HTTPower.Test for mocking HTTP requests in tests.
The test interceptor runs before Finch is called, providing adapter-agnostic testing.
Performance
Finch is recommended for high-throughput production scenarios where explicit connection pooling control and maximum performance are priorities. It's built on Mint, the same low-level library that powers Req.
Summary
Functions
Default Finch pool configuration used when :finch_pools is not overridden.
Functions
@spec default_pools() :: map()
Default Finch pool configuration used when :finch_pools is not overridden.
Pins verify: :verify_peer explicitly so HTTPower's "TLS verify-by-default"
guarantee is owned here rather than inherited from Mint's default (which has
historically flip-flopped). Mint supplies the system CA store for
verify_peer, so this is behavior-identical to the backend default while
ensuring it can't be silently downgraded. Started by HTTPower.Application.