Mix Tasks in umbrella applications

72 views
Skip to first unread message

l...@expert360.com

unread,
Apr 3, 2018, 3:01:14 AM4/3/18
to elixir-lang-core
I have an issue with how mix tasks work within umbrella applications.

Our umbrella application has a large number of sub applications and a large number of dependencies. These dependencies connect to AMQP, our databases, elasticsearch, and other services. This has caused a large initialization time.

When running mix tasks, it seems all of these external services are needed and the full application needs to be initialized before any of the tasks can run.

This has caused the mix tasks defined to slow down immensely. 

What is the idiomatic way in elixir to do mix tasks? How can we make sure that a mix task doesn't require the whole application to completely initialize before being run? 

I have looked at the phoenix library and it seems to only initialize the phoenix application when `phx.server` is explicitly run. If this is the idiomatic way to accomplish this, how do we make sure that all of our dependencies don't also start as well?


I am looking for a proper way to do this in elixir that is supported by the community. 

José Valim

unread,
Apr 3, 2018, 4:07:51 AM4/3/18
to elixir-l...@googlegroups.com
Hi,

The goal of the umbrella is exactly to run all applications together while also allowing you to run each application in the umbrella in isolation. If you want to start only a subset of those applications, then you should define the mix task the proper apps/XYZ application and run the mix task from within the application.

Also please note this mailing list is for discussing features proposals and enhancements to the language. For general questions, please consider the Elixir Forum or a medium such as Stack Overflow.



José Valim
Founder and 
Director of R&D

Want to get insights, recommendations and answers from top consultants for free? Head to Discussions to ask questions and find answers.

———————————————————————————————————————————————
This email is intended for the sole use of the intended recipient(s) and may contain information that is confidential and/or privileged.  Any review or distribution by any other person is prohibited.  If you are not an intended recipient, please immediately contact the sender and delete all copies of this email message

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/0f7c982a-8267-430c-8d5a-41fedcc97d3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

l...@expert360.com

unread,
Apr 3, 2018, 7:47:03 PM4/3/18
to elixir-lang-core
Thanks José,
I can duplicate this question on the Elixir forum if you'd like as I think this answer is incredibly valuable to the umbrella project users.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages