]> Entropealabs - wampex_client.git/commitdiff
allow start_link to be overridden
authorChristopher Coté <chris@entropealabs.com>
Thu, 11 Nov 2021 20:37:35 +0000 (15:37 -0500)
committerChristopher Coté <chris@entropealabs.com>
Thu, 11 Nov 2021 20:37:35 +0000 (15:37 -0500)
lib/client/handler.ex
mix.exs

index 4f26224d0037ea059c0cf52c29ba54882b152a83..e4defe7bec9b310cf10c87afeb6c83eba32921a1 100644 (file)
@@ -31,12 +31,6 @@ defmodule Wampex.Client.Handler do
         {:ok, add_client(state, cn)}
       end
 
-      defp add_client(state, cn) when is_struct(state) do
-        struct(state, %{client_name: cn})
-      end
-
-      defp add_client(state, cn), do: Map.put(state, :client_name, cn)
-
       @impl true
       def handle_continue({:registered, _}, state), do: {:noreply, state}
 
@@ -58,7 +52,13 @@ defmodule Wampex.Client.Handler do
         state
       end
 
-      defoverridable do_init: 1, handle_continue: 2
+      defp add_client(state, cn) when is_struct(state) do
+        struct(state, %{client_name: cn})
+      end
+
+      defp add_client(state, cn), do: Map.put(state, :client_name, cn)
+
+      defoverridable start_link: 1, do_init: 1, handle_continue: 2
     end
   end
 
diff --git a/mix.exs b/mix.exs
index ea38e4966334d93bad5b8f58aefb1ffd319aa82a..3b0125e5cc9c525331bcab80716de99c765d9034 100644 (file)
--- a/mix.exs
+++ b/mix.exs
@@ -4,7 +4,7 @@ defmodule Wampex.Client.MixProject do
   def project do
     [
       app: :wampex_client,
-      version: "0.1.3",
+      version: "0.1.4",
       elixir: "~> 1.9",
       start_permanent: Mix.env() == :prod,
       elixirc_paths: elixirc_paths(Mix.env()),