Created
April 10, 2018 22:16
-
-
Save robmckinnon/9dd656a7e68384d65306849959da84ed to your computer and use it in GitHub Desktop.
Add GenServer implementation to supervision tree in application.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule NodeProcess.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 = [ | |
# Starts a worker by calling: NodeProcess.Worker.start_link(arg) | |
{NodeProcess.Server, :ok} | |
] | |
# See https://hexdocs.pm/elixir/Supervisor.html | |
# for other strategies and supported options | |
opts = [strategy: :one_for_one, name: NodeProcess.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