Skip to content

Instantly share code, notes, and snippets.

@mzemel
Created October 22, 2015 00:30
Show Gist options
  • Save mzemel/44e7c1d7373417e7aa9f to your computer and use it in GitHub Desktop.
Save mzemel/44e7c1d7373417e7aa9f to your computer and use it in GitHub Desktop.
defmodule Calculator do
use Application
# See http://elixir-lang.org/docs/stable/elixir/Application.html
# for more information on OTP Applications
def start(_type, initial_value) do
import Supervisor.Spec, warn: false
children = [
# Define workers and child supervisors to be supervised
worker(Calculator.Server, [initial_value])
]
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: Calculator.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