]> Entropealabs - wampex_client.git/commitdiff
handle exit gracefully while trapping exits
authorChristopher Coté <chris@entropealabs.com>
Wed, 15 Jun 2022 17:40:38 +0000 (13:40 -0400)
committerChristopher Coté <chris@entropealabs.com>
Wed, 15 Jun 2022 17:40:38 +0000 (13:40 -0400)
lib/client/session.ex

index ec1b7c80b1efc11833241add06a7b043fe5cdd97..7755b44f5c2ed62f7cd9e264148c151622c1de20 100644 (file)
@@ -383,6 +383,9 @@ defmodule Wampex.Client.Session do
      [{:next_event, :internal, :message_received}]}
   end
 
+  @impl true
+  def handle_info({:EXIT, _, _}, _, state), do: {:stop, :normal, state}
+
   defp handle_response(nil, actions, requests, _), do: {requests, actions}
 
   defp handle_response(id, actions, requests, response) do