Skip to content

Instantly share code, notes, and snippets.

@adrianparvino
Created June 11, 2019 10:40
Show Gist options
  • Save adrianparvino/c533513e9ccad196760ae2f72b24c230 to your computer and use it in GitHub Desktop.
Save adrianparvino/c533513e9ccad196760ae2f72b24c230 to your computer and use it in GitHub Desktop.
defmodule TermuxSmsCli.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
def start(_type, _args) do
# List all child processes to be supervised
children = if System.get_env("ANDROID_ROOT") do
[ { TermuxSmsCli.Fetcher, name: TermuxSmsCli.Fetcher }
] else
[
] end
# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: TermuxSmsCli.Supervisor]
Supervisor.start_link(children, opts)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment