[英]Erlang and Elixir/Phoenix in the same app
Has anyone used Erlang and Elixir in the same app? 有人在同一应用程序中使用过Erlang和Elixir吗? Would it be better to keep two separate repos - one for Erlang app and one for Phoenix/Elixir app? 最好保留两个单独的存储库-一个用于Erlang应用程序,另一个用于Phoenix / Elixir应用程序?
Or can one combine Erlang/Elixir in the same app structure - as two different apps? 还是可以将Erlang / Elixir与两个不同的应用程序结合在同一应用程序结构中?
Thanks 谢谢
I've used Erlang apps inside Elixir. 我在Elixir中使用过Erlang应用程序。 For example, when I need a rich name register, I often use :gproc
which is an Erlang app. 例如,当我需要一个全名注册时,我经常使用:gproc
这是一个Erlang应用程序。 In my mix.exs
file I just add it to my applications: 在我的mix.exs
文件中,将其添加到我的应用程序中:
defmodule MyApp.Mixfile do
use Mix.Project
(...)
def application do
[applications: [:logger, :gproc],
mod: {MyApp, []}]
end
defp deps do
[{:gproc, "~> 0.5.0"}]
end
end
I personally would keep the apps in separate repositories mainly because they have a different project structure, but you can use them together by adding them to the dependencies of your project just like I did with :gproc
in the example. 我个人将这些应用程序保存在单独的存储库中,主要是因为它们具有不同的项目结构,但是您可以通过将它们添加到项目的依赖项中来将它们一起使用,就像在示例中使用:gproc
一样。
I hope this answer your question. 我希望这能回答您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.