From 2fbe1c9c20a600d16fdde381b0310bd3cb2edb3d Mon Sep 17 00:00:00 2001 From: Jeff Weiss Date: Tue, 29 Mar 2016 22:04:43 -0700 Subject: prefer Elixir module variants over Erlang ones Prior to this commit exirc used `:gen_server` and `:supervisor` over the Elixir variants `GenServer` and `Supervisor`, respectively. The commit changes to modules to the Elixir variants mostly to reduce the cognitive load on contributors, particularly those who are not yet well versed in Erlang. --- lib/exirc/exirc.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/exirc/exirc.ex') diff --git a/lib/exirc/exirc.ex b/lib/exirc/exirc.ex index 719c9ed..cfa2654 100644 --- a/lib/exirc/exirc.ex +++ b/lib/exirc/exirc.ex @@ -41,7 +41,7 @@ defmodule ExIrc do """ @spec start! :: {:ok, pid} | {:error, term} def start! do - :supervisor.start_link({:local, :exirc}, __MODULE__, []) + Supervisor.start_link(__MODULE__, [], name: :exirc) end @doc """ @@ -50,7 +50,7 @@ defmodule ExIrc do @spec start_client! :: {:ok, pid} | {:error, term} def start_client! do # Start the client worker - :supervisor.start_child(:exirc, []) + Supervisor.start_child(:exirc, []) end ############## -- cgit v1.2.3