Created
May 17, 2017 04:45
-
-
Save Sparkmasterflex/3af5adde3d6b4b7d6314e30f699713fd to your computer and use it in GitHub Desktop.
GameOfLife module: Following game of life tutorial and getting a GenServer.call() no process error
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 GameOfLife do | |
use Application | |
@moduledoc """ | |
Documentation for GameOfLife. | |
""" | |
def start(_type, _args) do | |
import Supervisor.Spec, warn: false | |
init_alive_cells = [] | |
children = [ | |
# Define workers and child supervisors to be supervised | |
# worker(GameOfLife.Worker, [arg1, arg2, arg3]), | |
supervisor(Task.Supervisor, [[name: GameOfLife.TaskSupervisor]]), | |
worker(GameOfLife.BoardServer, [init_alive_cells]), | |
# We will uncomment this line later | |
# worker(GameOfLife.GamePrinter, []), | |
] | |
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html | |
# for other strategies and supported options | |
opts = [strategy: :one_for_one, name: GameOfLife.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