Skip to content

Instantly share code, notes, and snippets.

View m1dnight's full-sized avatar

Christophe De Troyer m1dnight

View GitHub Profile
@m1dnight
m1dnight / gen_server_tpl.ex
Last active March 2, 2018 09:53 — forked from ntrepid8/gen_server_tpl.ex
Elixir GenServer Template
defmodule Server do
@moduledoc """
A GenServer template for a "singleton" process.
"""
use GenServer
require Logger
def start_link(opts \\ []) do
Logger.debug "Started with opts: #{inspect opts}"
GenServer.start_link(__MODULE__, opts, [name: __MODULE__])