elixir 模块名一些参考资料
elixir 的模块名实际上是一个atom 类型的数据,以下是一些参考资料
参考使用
比如一个mix sup 项目
defmodule EctoDemo.Application do
use Application
@impl true
def start(_type, _args) do
children = [
]
# 此处name 实际上就是使用了模块名格式的,因为是一个atom,所以此处可以使用任意名称,只是默认项目使用了EctoDemo.Supervisor 格式的,明确这是一个Supervisor
opts = [strategy: :one_for_one, name: EctoDemo.Supervisor]
Supervisor.start_link(children, opts)
end
end
实际上可以修改为其他格式的,通过observer 监控看到的信息如下(我修改了name 为EctoDemo.Supervisor.Dalong)
参考资料
https://tylerpachal.medium.com/why-do-erlang-modules-look-like-atoms-in-elixir-9fb2f964dd2b
https://www.oreilly.com/library/view/programming-elixir/9781680500530/f_0060.html
https://stackoverflow.com/questions/29674102/is-elixirs-module-an-atom
https://hexdocs.pm/elixir/1.15.7/Module.html
https://hexdocs.pm/elixir/1.15.7/Supervisor.html
https://elixirforum.com/t/what-are-module-and-function-names-exactly-they-seem-to-be-more-than-atoms/47632/4
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2023-01-04 dremio DatasetSaver 服务说明
2023-01-04 dremio datastore简单说明
2023-01-04 piperider 开源数据可靠性工具
2022-01-04 census 安全处理模式
2022-01-04 castled 简单原理说明
2021-01-04 goja 支持es6的一种方法
2021-01-04 salesforce 跨组织数据可见性的方案