【发布时间】:2017-10-24 09:49:43
【问题描述】:
我尝试使用长生不老药。
application.ex 有点难理解
defmodule PluralsightTweet.Application do
# See http://elixir-lang.org/docs/stable/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
# Define workers and child supervisors to be supervised
children = [
# Starts a worker by calling: PluralsightTweet.Worker.start_link(arg1, arg2, arg3)
worker(PluralsightTweet.TweetServer, [])
]
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: PluralsightTweet.Supervisor]
process = Supervisor.start_link(children, opts)
PluralsightTweet.Scheduler.schedule_file("* * * * *", Path.join("#{:code.priv_dir(:pluralsight_tweet)}",
"sample.txt"))
process
end
end
我正在关注复数灵药教程 这是从读取文本文件中每分钟发送文本的调度程序
任务是成功的,但对过程没有清晰的理想
谁能解释一下 application.ex 内部发生了什么 作为主管应用程序运行
【问题讨论】:
标签: erlang elixir erlang-otp