1 defmodule Pleroma.HTTP.Connection do
3 Connection for http-requests.
6 @hackney_options [pool: :default]
7 @adapter Application.get_env(:tesla, :adapter)
10 Configure a client connection
16 @spec new(Keyword.t()) :: Tesla.Env.client()
17 def new(opts \\ []) do
18 Tesla.client([], {@adapter, hackney_options(opts)})
21 # fetch Hackney options
23 defp hackney_options(opts \\ []) do
24 options = Keyword.get(opts, :adapter, [])
25 @hackney_options ++ options