New to Elixir but loving it so far :)
A lot of my mix tasks depend on HTTPotion.
My mix.exs
file is declared as such
def application do
[
applications: [:logger, :cowboy, :plug, :httpotion, :poison],
mod: {BiddingAgent, []}
]
end
So HTTPotion.start is called automatically. However, when I run a task like mix campaign.list
which needs to call an http request, I have to manually call HTTPotion.start
.
What is the idiomatic way to make sure the right processes are started for my mix tasks?
Thanks!
mix test
and seeing that you must haveExUnit.start
in one of yourexs
files when running tests, I'd guess that you'll need to do the same thing with other applications that need to be started when running a mix task. I'd be happy if I was wrong. – CoderDennis