Created
February 13, 2016 02:34
-
-
Save jmsevold/41efa0d1b7e4867d72e6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 MyApp do | |
use Application | |
# See http://elixir-lang.org/docs/stable/elixir/Application.html | |
# for more information on OTP Applications | |
def start(_type, _args) do | |
import Supervisor.Spec, warn: false | |
children = [ | |
worker(Todo, [[]]) | |
] | |
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html | |
# for other strategies and supported options | |
opts = [strategy: :one_for_one, name: MyApp.Supervisor] | |
Supervisor.start_link(children, opts) | |
end | |
end |
@jmsevold can you post your Todo GenServer also?
@jmsevold Could it be that you start your GenServer with "start" and not "start_link"?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
** (Mix) Could not start application my_app: MyApp.start(:normal, []) returned an error: shutdown: failed to start child: Todo
** (EXIT) an exception was raised:
** (UndefinedFunctionError) undefined function Todo.start_link/1
(my_app) Todo.start_link([])
(stdlib) supervisor.erl:343: :supervisor.do_start_child/2
(stdlib) supervisor.erl:326: :supervisor.start_children/3
(stdlib) supervisor.erl:292: :supervisor.init_children/2
(stdlib) gen_server.erl:328: :gen_server.init_it/6
(stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3