Fl4m3Ph03n1x

Fl4m3Ph03n1x

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?

Marked As Solved

Fl4m3Ph03n1x

Fl4m3Ph03n1x

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.

Also Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

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

OvermindDL1

OvermindDL1

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:

Fl4m3Ph03n1x

Fl4m3Ph03n1x

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

Where Next?

Popular in Questions Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New

Other popular topics Top

peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New

We're in Beta

About us Mission Statement