How to use pools with HTTPotion?

Background

I am looking for alternative HTTP libraries to HTTPoison. Once such library is HTTPotion.

Problem

However I need to use pools, but the documentation doesn’t mention them. I don’t know how nor if I can do it.

Question

  • How do I use request pools with HTTPotion?

HTTPoison tends to be a lot more featureful than HTTPotion as it’s based on hackney and HTTPotion is based on ibrowse.

If Hackney’s/HTTPoison’s pools are insufficient, have you looked at Tesla instead? It supports a variety of backends (the default recommended one is indeed still hackney) but a unified interface to them all so you can try different ones for your purpose.

And it’s not hard to make your own pool either. :slight_smile:

1 Like

Solution

You can’t. HTTPotion doesn’t support pools, so if you want to use pools you would have to use something like poolboy and join them together.

@OvermindDL1
I believe Tesla is overkill. All I want to do are simple HTTP GET requests. Millions of them. Hackney can’t handle it so I can’t use anything that uses Hackney. But thanks for the link, it sure looks interesting.

Off-topic

This question was started because I was considering using pools with HTTPotion. The reason for this is that I usually default to using pools in every component I make without thinking, but Elixir is different in that processes are so cheap it is game changing.

Thus, I created another topic to reflect this:

Feel free to drop your 2cents.

Did you look at using https://github.com/ninenines/gun?

4 Likes

Didn’t know it existed. Looks rather promising, thanks !

1 Like