benoitc / hackney

simple HTTP client in Erlang
Other
1.34k stars 427 forks source link

Set use_default_pool #682

Closed spinettaro closed 3 years ago

spinettaro commented 3 years ago

Hi,

I'm using Elixir and HTTPoison and I would like, for a test purpose, to disable the default pool as described in the main Readme. How can I set the hackney application environment key use_default_pool to false? I have a Elixir Phoenix project.

Thanks in advance

benoitc commented 3 years ago

apparently you can set it using the mix file. Hope it helps.

spinettaro commented 3 years ago

@benoitc could you show me the code in practice please? Thanks :)

benoitc commented 3 years ago

http://blog.plataformatec.com.br/2016/05/how-to-config-environment-variables-with-elixir-and-exrm/

On Thu, May 20, 2021 at 7:40 PM Daniele Spinetti @.***> wrote:

@benoitc https://github.com/benoitc could you show me the code in practice please? Thanks :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/benoitc/hackney/issues/682#issuecomment-845324949, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADRIRNX5IZV62JK7GMO2LTOVCPJANCNFSM4ZMKOJ3A .

Trevoke commented 10 months ago

@spinettaro I am guessing that this would be config :hackney, use_default_pool: false but I am running into a frustrating {:error, :closed} that I can't get rid of (OpenAI package -> HTTPoison package -> Hackney package) and so I don't think this works... Did you get it to work?

spinettaro commented 10 months ago

@Trevoke yes that was what I did. If I remember well it worked for me config :hackney, use_default_pool: false in my config file

benoitc commented 10 months ago

if someone can provide a pr to document it that can be helpful :)