Created
June 11, 2014 12:30
-
-
Save yehohanan7/768e6bd70a45a702592d 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 Server do | |
use GenServer.Behaviour | |
def start_link() do | |
:gen_server.start_link(__MODULE__, [], []) | |
end | |
end | |
defmodule Supervisor do | |
use Supervisor.Behaviour | |
def start_link do | |
:supervisor.start_link({:local, :my_sup}, __MODULE__, []) | |
end | |
def init(_) do | |
supervise([], strategy: :one_for_one) | |
end | |
def start_child() do | |
:supervisor.start_child(:my_sup, worker(Server, [], [])) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment