Salemove.HttpClient.Application (salemove_http_client v6.1.0)

Starts the default Finch pool used by Tesla.Adapter.Finch, the default adapter.

The pool is only started when the library is actually configured to use the Finch adapter: :finch must be available (it is an optional dependency - add it to your application's dependencies) and the adapter configured via the :salemove_http_client application environment must resolve to Tesla.Adapter.Finch (the default when no adapter is configured). Clients selecting the Finch adapter per module or per request must start their own named Finch instance.

The pool is registered under the name Salemove.HttpClient.Finch and can be configured via the :finch_pools application environment, which is passed verbatim as the :pools option to Finch.start_link/1:

config :salemove_http_client,
  finch_pools: %{
    default: [size: 50, conn_max_idle_time: 30_000, conn_opts: [transport_opts: [timeout: 1_500]]]
  }

Applications that need several pools (or per-host TLS/proxy settings) can either configure them here or start their own named Finch instance and point clients at it with adapter_options: [name: MyApp.Finch].