]> Entropealabs - wampex_client.git/commitdiff
trap exits and call terminate
authorChristopher Coté <chris@entropealabs.com>
Tue, 23 Nov 2021 18:26:29 +0000 (13:26 -0500)
committerChristopher Coté <chris@entropealabs.com>
Tue, 23 Nov 2021 18:26:29 +0000 (13:26 -0500)
lib/client/handler.ex

index 86237ce9870f21b4f5f47c9f462d35f3bad5b43b..0108de2205ec86c70890f68b7d1dd06098e27f2d 100644 (file)
@@ -26,6 +26,7 @@ defmodule Wampex.Client.Handler do
 
       @impl true
       def init(opts) do
+        Process.flag(:trap_exit, true)
         {cn, opts} = Keyword.pop(opts, :client_name)
         state = do_init(opts)
         Client.add(cn, self())