Background
We have an app that deals with a considerable amount of requests per second. This app needs to notify an external service, by making a GET call via HTTPS to one of our servers.
Objective
The objective here is to use HTTPoison to make async GET requests. I don't really care about the response of the requests, all I care is to know if they failed or not, so I can write any possible errors into a logger.
If it succeeds I don't want to do anything.
Research
I have checked the official documentation for HTTPoison and I see that they support async requests:
https://hexdocs.pm/httpoison/readme.html#usage
However, I have 2 issues with this approach:
- They use
flush
to show the request was completed. I can't loggin into the app and manuallyflush
to see how the requests are going, that would be insane. - They don't show any notifications mechanism for when we get the responses or errors.
So, I have a simple question:
- How do I get asynchronously notified that my request failed or succeeded?
I assume that the default HTTPoison.get
is synchronous, as shown in the documentation.