1 defmodule Pleroma.HTTP.Connection do
2 @hackney_options [pool: :default]
3 @adapter Application.get_env(:tesla, :adapter)
6 Configure a client connection
12 @spec new(Keyword.t()) :: Tesla.Env.client()
13 def new(opts \\ []) do
14 Tesla.client([], {@adapter, hackney_options(opts)})
17 # fetch Hackney options
19 defp hackney_options(opts \\ []) do
20 options = Keyword.get(opts, :adapter, [])
21 @hackney_options ++ options